Skip to content

Instantly share code, notes, and snippets.

@goyalrohit
Created September 25, 2019 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goyalrohit/6e9530a0bd9a7239332565620ec4f050 to your computer and use it in GitHub Desktop.
Save goyalrohit/6e9530a0bd9a7239332565620ec4f050 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# A custom function to convert list to string
def convertListToString(listStr):
# Declaring the string to store output
strOutput = ""
# iterating through the list
for data in listStr:
strOutput += " " + data
# return the output added in string
return strOutput
# Declaring list which five elements
listStr = ['Lets', 'convert', 'list', 'to', 'string']
print(convertListToString(listStr))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment