Python challenge of the day!

Hello Students,

Create a Python script showcasing list iteration with both index and value. Craft code to print pairs like “Index: [index], Value: [value]”.

Happy Python learning.

2 Likes

@dkdebarun666

list = [7,2,50,4,76,6]
for i in range (len(list)):
print(“Index : “, i,”,”, "Value : ", list[i])

1 Like

@dkdebarun666
my_list = [21, 44, 35, 11]
for index in range(len(my_list)):
value = my_list[index]
print((‘Index: {}, Value: {}’).format(index, value))

1 Like