Demonstration on for Loop in Python
my_list=["book1","book2","book3",1,2,3]
for element in my_list:
print(element)
Output:
book1
book2
book3
1
2
3
Another Program,
colors=["Red","Yellow","Pink","White","Blue","Purple","Black"]
for color in colors:
print(color)
Output:
Red
Yellow
Pink
White
Blue
Purple
Black
Another Program,
fruits=["apple","banana","orange","pineapple"]
for fruit in fruits:
print(fruit)
Output:
apple
banana
orange
pineapple
0 टिप्पण्या
कृपया तुमच्या प्रियजनांना लेख शेअर करा आणि तुमचा अभिप्राय जरूर नोंदवा. 🙏 🙏