Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nums = []
- while True:
- num = int(input("Please enter a number: "))
- if num == 0:
- break
- nums.append(num)
- average = sum(nums)/len(nums)
- print(f'The average is {str(average)}')
- less = []
- equal = []
- more = []
- for i in nums:
- if i < average:
- less.append(i)
- elif i == average:
- equal.append(i)
- elif i > average:
- more.append(i)
- print("The numbers less than the average are: ", less)
- print("The numbers equal to the average are: ", equal)
- print("The numbers more than the average are: ", more)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement