viligen

sorted_numbers

Oct 20th, 2021
1,001
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. numbers = list(map(int, input().split()))
  2.  
  3. average = sum(numbers) / len(numbers)
  4.  
  5. filtered = [n for n in numbers if n > average]
  6. sorted = sorted(filtered, reverse=True)
  7. sorted_5 = sorted[:5]
  8.  
  9. if not sorted_5:
  10.     print("No")
  11. else:
  12.     print(*sorted_5)
RAW Paste Data