We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Strings
- String Split and Join
- Discussions
String Split and Join
String Split and Join
Sort by
recency
|
1119 Discussions
|
Please Login in order to post a comment
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)
return "-".join(line.split(" "))
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.