list = [56, Tree, 776, 89, Five, One, 43, Apple]
print(list.count(type(str)))
a = [56, "Tree", 776, 89, "Five", "One", 43, "Apple"] print([x for x in a if not str(x).isdigit()])
a = [56, "Tree", 776, 89, "Five", "One", True, (True, "Goo"), "Apple"] b = [x for x in a if isinstance(x, str)] print(len(b))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)