Answers for "find type of an element in list python"

0

find type of an element in list python

mylist = ["hello", "world", 1, 2, 9999, "pizza", 42, ["this", "is", "a", "sub list"], -100]
type(mylist[3])
#int
type(mylist[1])
#str
type(mylist[-2])
#list
type(mylist[-2][1])
#str
Posted by: Guest on October-06-2020

Code answers related to "find type of an element in list python"

Python Answers by Framework

Browse Popular Code Answers by Language