avatar Intro Bite 04. Split and join

Split up the message on newline (\n) using the split builtin, then use the join builtin to stitch it together using a '|' (pipe).

So Hello world:\nI am coding in Python :)\nHow awesome! would turn into: Hello world:|I am coding in Python :)|How awesome!

Your code should work for other message strings as well.

Note that as opposed to previous Intro Bites you need to return the new string!

Also note that, although we wanted you to learn about split and join here, there are more ways to pull this one off (check out the forum upon resolving this Bite ...)

Login and get coding
go back Intro level
Bitecoin 1X

4514 out of 4665 users completed this Bite.
Will you be the 4515th person to crack this Bite?
Resolution time: ~26 min. (avg. submissions of 5-240 min.)
Our community rates this Bite 3.19 on a 1-10 difficulty scale.
» You can do it! 😌

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help