Advertisement
DiYane

Group of 10's

Sep 25th, 2023
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. numbers = list(map(int, input().split(', ')))
  2.  
  3. for group in range(1, 11):
  4.     if len(numbers) == 0:
  5.         break
  6.     group_list = [num for num in numbers if num <= (group * 10)]
  7.     numbers = [num for num in numbers if num not in group_list]
  8.     print(f"Group of {group}0's: {group_list}")
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement