Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numbers=[1,2,3,-20,10]
- mean=0
- for i in numbers:
- mean=i+mean
- mean=mean/len(numbers)
- i=1
- '''while i < len(numbers):
- j=0
- for j in range(len(numbers)-i):
- if numbers[j] < numbers[j+1]:
- numbers[j], numbers[j+1] = numbers[j+1], numbers[j]
- i=i+1'''
- numbers.sort()
- median_number=numbers[int(len(numbers)/2)]
- if mean > median_number:
- print('mean')
- elif median_number > mean:
- print('median')
- elif median_number == mean:
- print('same')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement