Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def filter_numbers_above_average(numbers, average_sum):
- above_average_list = []
- count = 0
- for number in numbers:
- if number > average_sum:
- above_average_list.append(number)
- count += 1
- if count == 5:
- break
- return above_average_list
- def main():
- number_sequence = sorted(map(int, input().split()), reverse=True)
- average_number = sum(number_sequence) / len(number_sequence)
- top_five_greatest_numbers = filter_numbers_above_average(number_sequence, average_number)
- if not top_five_greatest_numbers:
- print("No")
- else:
- print(*top_five_greatest_numbers, sep=" ")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement