find type of an element in list python

Solutions on MaxInterview for find type of an element in list python by the best coders in the world

showing results for - "find type of an element in list python"
Esmay
03 Apr 2018
1mylist = ["hello", "world", 1, 2, 9999, "pizza", 42, ["this", "is", "a", "sub list"], -100]
2type(mylist[3])
3#int
4type(mylist[1])
5#str
6type(mylist[-2])
7#list
8type(mylist[-2][1])
9#str