String Split and Join

Sort by

recency

|

1068 Discussions

|

  • + 0 comments

    def split_and_join(line): split_line = line.split(" ") join_line = "-".join(split_line) return join_line

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

    def split_and_join(line): # write your code here

    return '-'.join(line.split(' '))
    
  • + 0 comments
    def split_and_join(line):
        line=line.split(' ')
        applesauce='-'.join(line)
        return applesauce