avatar Bite 54. Nicer formatting of a poem or text

In this Bite you complete print_hanging_indents to print a poem (or text) in a nicer way.

For example calling it on (part of) Christina Rosetti's Remember it should convert:

                      Remember me when I am gone away,
                      Gone far away into the silent land;
                      When you can no more hold me by the hand,

                      Nor I half turn to go yet turning stay.

                      Remember me when no more day by day
                      You tell me of our future that you planned:
                      Only remember me; you understand

to:

Remember me when I am gone away,
    Gone far away into the silent land;
    When you can no more hold me by the hand,
Nor I half turn to go yet turning stay.
Remember me when no more day by day
    You tell me of our future that you planned:
    Only remember me; you understand

print the resulting poem (don't return it)! The tests include another text snippet from Shakespeare. Have fun!

Login and get coding
go back Beginner level
Bitecoin 2X

537 out of 570 users completed this Bite.
Will you be Pythonista #538 to crack this Bite?
Resolution time: ~52 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 5.82 on a 1-10 difficulty scale.
» Up for a challenge? 💪

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

Ask for Help