Python Forum
I need to answer this: For the following list, print each element in the list an it’s - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: I need to answer this: For the following list, print each element in the list an it’s (/thread-5148.html)



I need to answer this: For the following list, print each element in the list an it’s - ralfi - Sep-20-2017

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??????


RE: I need to answer this: For the following list, print each element in the list an it’s - snippsat - Sep-20-2017

Add type(i).