| s02220725 LookSay 4716 | Антипова Алёна 425 гр. LookSay 4699 | ||||
|---|---|---|---|---|---|
| f | 1 | from itertools import groupby | f | 1 | from itertools import groupby |
| 2 | 2 | ||||
| 3 | def LookSay(): | 3 | def LookSay(): | ||
| n | 4 | num = '1' | n | 4 | s = '1' |
| 5 | while True: | 5 | while True: | ||
| t | 6 | for digit in num: | t | 6 | for c in s: |
| 7 | yield int(digit) | 7 | yield int(c) | ||
| 8 | num = ''.join((str(len(list(g))) + k for k, g in groupby(num))) | 8 | s = ''.join((str(len(list(count))) + num for num, count in group | ||
| > | by(s))) | ||||
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||