+ 2
How to check type in list
How to check type of list member in list, like is this int or str?
1 Answer
+ 5
my_list = ['abc', 4, (5,'#x27;)]
for item in my_list:
print(type(item))
# outputs:
# <class 'str'>
# <class 'int'>
# <class 'tuple'>
How to check type of list member in list, like is this int or str?