String Split and Join

  • + 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)