String Split and Join

Sort by

recency

|

1121 Discussions

|

  • + 0 comments

    For Python3 Platform

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

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

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