0
Can someone help me with the following program please.
Write a python program uses a WHILE loop. The program must prompt the user to enter the integer number. The value must be added to a total. The loop must continue until the total exceed 45. After the loop, the average of the members must be calculated. The program must display each of the input values, as well as the sum of all values and the average value.
2 Réponses
+ 2
Kindly first show your attempt.Then we would help you in your code.
0
total =45
count=0
InputValue= [ ]
while total <= 45:
user = int(input("Enter the integer : ")
total= total+user
count= count+1
inputValue.append(user)
print(" Input Values": ,inputValue)
print(" sum value :"+str(total))
print("Average value :" +str(total/count))