Created
September 25, 2019 17:57
-
-
Save goyalrohit/308a721051db6fe0748fc93ffc69e104 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python | |
# string representation of a list | |
strList = "[String, to, List, 1, 2 ,3]" | |
# # printing string variable and its type | |
print (strList) | |
print (type(strList)) | |
# using strip and split and assign to the list variable | |
listOut = strList.strip('][').split(', ') | |
# printing list variable and its type | |
print (listOut) | |
print (type(listOut)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment