Type of all elements in Python list -
is there way print out type of all elements of given list in python?
for example [1, 2, 3.5]
give int, int, float
.
the closest existing resource i've found answering question is: test type of elements python tuple/list, gives holistic true/false outputs (which not i'm looking for).
try following:
for l in lst: print(type(l))
where lst = [1,2,3.5]
Comments
Post a Comment