micropython/tests/basics/builtin_enumerate.py

17 lines
409 B
Python
Raw Normal View History

try:
enumerate
except:
print("SKIP")
raise SystemExit
2014-01-14 23:55:01 +00:00
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))))
2014-01-14 23:55:01 +00:00
# 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)))