python3 сортиране индекси
items=['baseball','basketball','football']
for index, item in enumerate(items):
print(index, item)
python за индекса на iterator
for index, value in enumerate(iterator):
print(index, value)
NU
# 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))
NU
colors = ["red", "green", "blue", "purple"]
ratios = [0.2, 0.3, 0.1, 0.4]
for color, ratio in zip(colors, ratios):
print("{}% {}".format(ratio * 100, color))