Advertisement
Nenogzar

Untitled

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