Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using .join()
#1
Hi there,

I'm supposed to join up the string by entering an input. I can't seem to get it to work, I suspect the separator i input might not be a string. Any advice?

phrase_words = ['Jack', 'and', 'Jill', 'went', 'up', 'the', 'hill', 'To', 'fetch', 'a', 'pail', 'of', 'water']

separator = input("Enter: ")

print(separator.join(phrase_words))
Thanks
Reply


Messages In This Thread
Using .join() - by extricate - Jun-26-2020, 06:40 AM
RE: Using .join() - by ndc85430 - Jun-26-2020, 06:51 AM
RE: Using .join() - by extricate - Jun-26-2020, 06:57 AM
RE: Using .join() - by ndc85430 - Jun-26-2020, 07:02 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020