Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
gist for my medium blogs
## I am simply creating a list and printing out the type of indivisual elements in the list ..
List = [1,2.0,"Hello World",True,[1,2,3,4,5],{'key':'value'}]
# I am using for in loop because the size of the list is fixed ..
for element in List:
print(type(element))
# or you can also use list compreshension
elements = [type(element) for element in List]
print(elements)
@tylerjusfly

This comment has been minimized.

Copy link

@tylerjusfly tylerjusfly commented May 31, 2020

💪 list comphrension??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.