For Loops in Python

monday_temperatures=[9.1,8.8,7.6]

# print(round(monday_temperatures[0]))
# print(round(monday_temperatures[1]))
# print(round(monday_temperatures[2]))

for temperatures in monday_temperatures:
    print(round(temperatures))
    print("done")


for letter in "Hello":
    print(letter.title())

 

colors = [11, 34, 98, 43, 45, 54, 54]

for items in colors:
    if items>50:
        print(items)

 

colors = [11, 34.1, 98.2, 43, 45.1, 54, 54]


for items in colors:
    
    if isinstance(items,int):
        if(items>50):
            print(items)


 

colors = [11, 34.1, 98.2, 43, 45.1, 54, 54]


for items in colors:
    
    if isinstance(items,int):
        print(items)

 

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *