Created
June 10, 2019 09:15
-
-
Save karanjagota/1ce12b8c5e3c437a1d2fd8863604626a to your computer and use it in GitHub Desktop.
gist for my medium blogs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
💪 list comphrension??