Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 06. Group of 10's:
- import math
- nums = list(map(lambda x: int(x), input().split(", ")))
- max_num = max(nums)
- previous_group = 0
- for i in range(1, (math.ceil(max_num / 10)) + 1):
- current_group = i * 10
- filtered_numbers = [number for number in nums if previous_group < number <= current_group]
- previous_group += 10
- print(f"Group of {i * 10}'s: {filtered_numbers}")
Advertisement
Add Comment
Please, Sign In to add comment