String Split and Join

Sort by

recency

|

1111 Discussions

|

  • + 0 comments

    ****def split_and_join(h): h=line.split(" ") h="-".join(h) return(h)

    if name =='main':line = input() result=split_and_join(line)print(result)

  • + 0 comments

    Add this single line : nline = "-".join(line.split())

  • + 0 comments

    It’s a great example of how Python makes common string operations intuitive and readable. A perfect warm-up for beginners learning string manipulation! 11xplay.com account create

  • + 0 comments

    def split_and_join(line): a = line.split(" ") a = "-".join(a) return a if name == 'main': line = input() result = split_and_join(line) print(result)

  • + 0 comments

    def split_and_join(line): result1 = line.split() result ='-'.join(result1) return result

    if name == 'main': line = input() result = split_and_join(line) print(result)