Skip to content

Instantly share code, notes, and snippets.

@goyalrohit
Created September 25, 2019 17:55
Show Gist options
  • Save goyalrohit/bf0e370c17257c35e0600ec57bb53910 to your computer and use it in GitHub Desktop.
Save goyalrohit/bf0e370c17257c35e0600ec57bb53910 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# A custom function to convert string to list
def convertStrToList(myStr):
myList = list(myStr.split("_"))
return myList
# Declaring a string
myStr = "String_to_List"
print(convertStrToList(myStr))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment