Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
no vowels function
#1
Hi,
using codecademy for Python learning.
In one of the exercises, were asked to write a function deleting all vowels from a string (upper and lower).
Tried the following, didn't work. Do I misinterpret the replace function?

def anti_vowel (text):
  new = text.lower()
  for l in new:
    if l=="a" or l=="u" or l=="e" or l=="i" or l=="o":
      text.replace(l,"")
  return text
Reply


Messages In This Thread
no vowels function - by alex_bgtv - Jan-01-2018, 08:16 AM
RE: no vowels function - by Mekire - Jan-01-2018, 08:29 AM
RE: no vowels function - by squenson - Jan-01-2018, 09:22 AM
RE: no vowels function - by alex_bgtv - Jan-01-2018, 02:09 PM
RE: no vowels function - by squenson - Jan-01-2018, 02:46 PM
RE: no vowels function - by snippsat - Jan-01-2018, 03:08 PM
RE: no vowels function - by alex_bgtv - Jan-01-2018, 08:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  remove vowels in word with conditional ambrozote 12 7,083 May-02-2021, 06:57 PM
Last Post: perfringo
  counting vowels in a string project_science 3 6,798 Dec-30-2020, 06:44 PM
Last Post: buran
  Counting vowels in a string (PyBite #106) Drone4four 4 3,553 Jul-07-2020, 05:29 AM
Last Post: theknowshares
  replace vowels niru 9 23,846 Sep-26-2017, 12:46 PM
Last Post: nilamo
  Vowels and Consonants detector OmarSinno 5 11,437 Sep-21-2017, 02:27 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020