Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. # A custom function to convert list to string
  4.  
  5. def converttoStr(listChar):
  6.  
  7. # Declaring the string to store output
  8. output = ""
  9.  
  10. # traversing the list of chars
  11. for data in listChar:
  12. output += data
  13.  
  14. # the string output
  15. return output
  16.  
  17.  
  18. # Declaring list of characters
  19. listChar = ['L', 'i', 's', 't', 'T', 'o', 'S', 't', 'r', 'i', 'n', 'g']
  20. print(converttoStr(listChar))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement