i am relatively new to python so i have been making random project for practice currently practicing objects and classes currently i am struggling with making a function that will check if a list has a class of objects in it and return true or false depending on whether or not it has an object of that class i tried using for loops and it always returns false even if it does contain an object of that class a = [1, 2, "apple"] for i in a: if i == int : print("is num") else: print(not num) i also tried lust comprehension but still same problem
Asked
Active
Viewed 18 times