String Split and Join

Sort by

recency

|

1119 Discussions

|

  • + 0 comments

    def split_and_join(line): words = line.split(" ") result="-".join(words) return result

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

  • + 0 comments

    return "-".join(line.split(" "))

  • + 0 comments

    That’s a clear example of how breaking down elements and rejoining them can simplify tasks, much like how well-structured PPC Strategies for Ecommerce break complex goals into manageable steps for better results.

  • + 0 comments
    def split_and_join(line):
        line = line.split(" ")
        line = "-".join(line)
        return line
    
    if __name__ == '__main__':
        line = input()
        result = split_and_join(line)
        print(result)
    
  • + 0 comments
    def split_and_join(line):
        # write your code here
        line = line.split(" ")
        return '-'.join(line)