Python 3.13.0 (tags/v3.13.0:60403a5, Oct 7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. DreamPie 1.2.1 >>> for x in 'ahoj': ... print(x) a h o j >>> for x in sorted('ahoj'): ... print(x) a h j o >>> for x in reversed('ahoj'): ... print(x) j o h a >>> for x in enumerate('ahoj'): ... print(x) (0, 'a') (1, 'h') (2, 'o') (3, 'j') >>> for x in enumerate('ahoj', 1): ... print(x) (1, 'a') (2, 'h') (3, 'o') (4, 'j') >>> for x in enumerate('ahoj', start=1): ... print(x) (1, 'a') (2, 'h') (3, 'o') (4, 'j') >>> for x in zip('ahoj', 'AHOJ'): ... print(x) ('a', 'A') ('h', 'H') ('o', 'O') ('j', 'J') >>> for x in zip('ahoj', 'AHOJ', '1234'): ... print(x) ('a', 'A', '1') ('h', 'H', '2') ('o', 'O', '3') ('j', 'J', '4') >>> for x in zip('ahoj'): ... print(x) ('a',) ('h',) ('o',) ('j',) >>> for x in zip('ahoj', 'AHOJ!'): ... print(x) ('a', 'A') ('h', 'H') ('o', 'O') ('j', 'J') >>> from itertools import zip_longest >>> for x in zip_longest('ahoj'): ... print(x) ('a',) ('h',) ('o',) ('j',) >>> for x in zip_longest('ahoj', 'AHOJ'): ... print(x) ('a', 'A') ('h', 'H') ('o', 'O') ('j', 'J') >>> for x in zip_longest('ahoj', 'AHOJ!'): ... print(x) ('a', 'A') ('h', 'H') ('o', 'O') ('j', 'J') (None, '!') >>> for x in zip_longest('ahoj', 'AHOJ!', fillvalue=' '): ... print(x) ('a', 'A') ('h', 'H') ('o', 'O') ('j', 'J') (' ', '!') >>> for x in zip_longest('ahoj', 'AHOJ!', ' '): ... print(x) ('a', 'A', ' ') ('h', 'H', None) ('o', 'O', None) ('j', 'J', None) (None, '!', None) >>>