python3 сортиране индекси
items=['baseball','basketball','football']
for index, item in enumerate(items):
print(index, item)
като зациклить дължината на масива pytoh
array = range(10)
for i in range(len(array)):
print(array[i])
python за индекса на цикъла
# Creates two variables; An index (num), and the value at that index (line)
for num, line in enumerate(lines):
print("{0:03d}: {}".format(num, line))
итерация с индекс на python
for index, item in enumerate(iterable, start=1):
print index, item
итерировать на масива с индекс на python
for header, rows in zip(headers, columns):
print("{}: {}".format(header, ", ".join(rows)))
python за индекс на масив цикли
colors = ["red", "green", "blue", "purple"]
i = 0
while i < len(colors):
print(colors[i])
i += 1