summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/enumerate.py
blob: 3cc1350a0f2deb7d17cb38bda11ac1e8d3f1113e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
try:
    enumerate
except:
    import sys
    print("SKIP")
    sys.exit()

print(list(enumerate([])))
print(list(enumerate([1, 2, 3])))
print(list(enumerate([1, 2, 3], 5)))
print(list(enumerate([1, 2, 3], -5)))
print(list(enumerate(range(100))))

# specifying args with keywords
print(list(enumerate([1, 2, 3], start=1)))
print(list(enumerate(iterable=[1, 2, 3])))
print(list(enumerate(iterable=[1, 2, 3], start=1)))