Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
 
PREVIOUS NEXT
Tagged: #find #type #element #list #python
ADD COMMENT
Topic
Name
3+5 =