TEXT   20

avelist py

Guest on 23rd August 2022 11:01:06 AM

  1. numlist = list()
  2. while (True):
  3.     inp = input('Enter a number: ')
  4.     if inp == 'done': break
  5.     value = float(inp)
  6.     numlist.append(value)
  7.  
  8. average = sum(numlist) / len(numlist)
  9. print('Average:', average)

Raw Paste


Login or Register to edit or fork this paste. It's free.