Skip to content

Latest commit

 

History

History
6 lines (5 loc) · 505 Bytes

File metadata and controls

6 lines (5 loc) · 505 Bytes

Write a function that takes a string and a bool y_is_vowel as input and returns a new string with all the vowels removed. For example, given the input "hello world", the function should return "hll wrld". If y_is_vowel is true, make sure to also remove y, else, vowel is considered a consonent, so don`t remove it.

For example:

  • remove_vowels_2(“Eric Mayhew”) → “rc Mhw”
  • remove_vowels_2(“CHEESE BURGER”) → “CHS BRGR”
  • remove_vowels_2(“1+1 = 2!”) → “1+1 = 2!”