lst1 = [77, "Pizza", 5 , 7, "Burger"]
print(type(lst1[0]), type(lst1[1]))
for i in lst1:
if i > 6:
print(i)
Since python interpreter can identify that which values of the list are integer and which values of the list are string, why in the if statement it is not working ?
Note: I am not asking the correct code, I just want to know why this code is not working ?
You just need to make sure the type is an integer, and then see if it's bigger than 6