The problem with this is, int == 10
is false. int
is a class, and 10
is an instance of the class. That doesn't mean however that they equate to each other.
You'd need to do some preprocessing first. There's many ways to do this, and it ultimately depends on what your end goal is, but as an example:
my_list = ["1", 10]
# Create a new list that holds the type of each element in my_list
types = [type(x) for x in my_list]
if int in types: # And check against the types, not the instances themselves
print("Integer in the list!")