Answers for "for python index and value"

27

python3 iterate through indexes

items=['baseball','basketball','football']
for index, item in enumerate(items):
    print(index, item)
Posted by: Guest on May-07-2020
0

iterating with index in for loops python

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))
Posted by: Guest on August-20-2020

Code answers related to "for python index and value"

Python Answers by Framework

Browse Popular Code Answers by Language