menu search
brightness_auto
more_vert
4 1
Topic Python Programming
Type Python Program
Class 10
thumb_up_off_alt 4 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
0
sum = 0
count = -1
num = None
while num!=0:
  num = int(input("Enter 0 to terminate, any other integer to continue: "))
  sum = sum + num
  count += 1
print("the sum is", sum)
print("the average is", sum/count)

 

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

Related questions

thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
...