Advertisement
Nenogzar

Group of 10's

Feb 9th, 2024 (edited)
1,235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. sequence = list(map(int, input().split(", ")))
  2.  
  3. max_sequence = max(sequence)
  4.  
  5. for group_start in range(1, max_sequence+1, 10):
  6.     group_end = group_start + 9
  7.     group_numbers = [num for num in sequence if group_start <= num <= group_end]
  8.     print(f"Group of {group_end}'s: {group_numbers}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement