String Split and Join

  • + 0 comments

    we can use this two methods adn make the code short and easy

    words = line.split()
    return '-'.join(words)
    
        or
    
    return line.replace(" ", "-")