avatar Intro Bite 06. Strip out vowels and count the number of replacements

In this Bite we'd like you to loop over the characters in the large block of text (the most important text for any Python programmer: The Zen of Python!)

Within this loop you'll perform the following actions:

  • Replace all vowels (aeiou) with stars (*), do this case insensitively.
  • Count the number of replacements you do (= vowels in the text).
  • Return the new block of text post replacements and the count of vowels you replaced.

Hint: Try converting the block of text to a list first to make working with the characters simpler.

Tip: If you're struggling, work on one step at a time and expand on your code slowly. Don't try and tackle every requirement right away.

Bonus: if you already have some Python under your belt, try to use re and try to solve it without a for loop :)

Login and get coding
go back Intro level
Bitecoin 1X

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

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

Ask for Help