Python Quiz 3 - "Using For Loop to see List's value is 'Numeric' and greater than '6' "

 Python Quiz 3 -

"Using For Loop to see List's value is 'Numeric' and greater than '6' "

CODE

list1 = ["s", "a", "b" , "k", 2, 3, 8, 7, 10, 458, -1, -100, 6, 6.56, 6.000001]
for items in list1:
if str(items).isnumeric() and items>6:
print(items)

"""Output ---
8
7
10
458
"""

Comments

Popular posts from this blog

Python Exercise 7 --- "Snake, Water, Gun"

Python Tutorial 38 --- "Self & __init__() (Constructors)(OOPS 3)"

Python Exercise 4 --- "Number Guessing Game"