Advertisement
Kobiesan

what the fuck is wrong

Oct 18th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. def listave(list):
  2.     UserInput = input('Enter integer (q to quit):')
  3.     list.append(UserInput)
  4.     while UserInput != 'q':
  5.         UserInput = input('Enter integer (q to quit:)')
  6.         if isinstance(UserInput, int) == True:
  7.             list.append(UserInput)
  8.         elif UserInput == 'q':
  9.             break
  10.     list.pop()
  11.     print('Average: ', float(sum(list) / len(list)))
  12.  
  13. listave(list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement