Petar_Matev

Untitled

Apr 2nd, 2021
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. # 06. Group of 10's:
  2. import math
  3. nums = list(map(lambda x: int(x), input().split(", ")))
  4. max_num = max(nums)
  5. previous_group = 0
  6. for i in range(1, (math.ceil(max_num / 10)) + 1):
  7.     current_group = i * 10
  8.     filtered_numbers = [number for number in nums if previous_group < number <= current_group]
  9.     previous_group += 10
  10.     print(f"Group of {i * 10}'s: {filtered_numbers}")
  11.  
Advertisement
Add Comment
Please, Sign In to add comment