File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ # 65- Create a program that reads several integers from the keyboard. At the end of the execution, show the average of
2+ # all the values and which were the highest and lowest values read. The program should ask the user whether or not he
3+ # wants to continue entering values.
4+ response = "Y"
5+ medium = soma = amount = bigger = smaller = 0
6+ while response in "Yy" :
7+ number = int (input ("Enter a number:" ))
8+ soma += number
9+ amount += 1
10+ if amount == 1 :
11+ bigger = smaller = number
12+ else :
13+ if number > bigger :
14+ bigger = number
15+ if number < smaller :
16+ smaller = number
17+ response = str (input ("Do you want to continue?" )).upper ().strip ()[0 ]
18+ medium = soma / number
19+ print (f"You entered { amount } and the averege is { medium } ." )
20+ print (f"The bigger is { bigger } and the smaller is { smaller } ." )
You can’t perform that action at this time.
0 commit comments