GH avatar Bite 105. Slice and dice

Take the block of text provided and strip off the whitespace at both ends. Split the text by newline (\n).

Loop through the lines, for each line:

  • strip off any leading spaces,
  • check if the first character is lowercase,
  • if so, split the line into words and get the last word,
  • strip the trailing dot (.) and exclamation mark (!) from this last word,
  • and finally add it to the results list.

Return the results list.

go back Intro level
Bitecoin 1X

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

Buy Now Login and get coding
We use Python 3.7