+ 2

How to check type in list

How to check type of list member in list, like is this int or str?

24th Nov 2017, 7:26 PM
Fatykhov Shamil
Fatykhov Shamil - avatar
1 Réponse
+ 5
my_list = ['abc', 4, (5,'
#x27;)] for item in my_list: print(type(item)) # outputs: # <class 'str'> # <class 'int'> # <class 'tuple'>
24th Nov 2017, 9:05 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar