Python Forum

Full Version: I need to answer this: For the following list, print each element in the list an it’s
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Heres the code I put
List = ['a','b',1,2,[1,2,3,4],'hello',(4,5,6),7,True,"False",2.3]
for i in List:
    print(i, type)
Output:
a <class 'type'> b <class 'type'> 1 <class 'type'> 2 <class 'type'> [1, 2, 3, 4] <class 'type'> hello <class 'type'> (4, 5, 6) <class 'type'> 7 <class 'type'> True <class 'type'> False <class 'type'> 2.3 <class 'type'>
what am I missing??????
Add type(i).