Python Forum
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
replace vowels
#5
That is not really what I suggested. I suggested two loops, one of the words in the list, one over the letters in vowels. I also suggested using replace to replace the vowels, and only appending to new_list after the loop over vowels is done (actually, I may have misstated that last part, but that's what it should be). Look at these lines:

for letter in mlist:
    if letter in vowels:
mlist is a list of words (names, really). So why would you call the loop variable 'letter'? And why would a whole name be in vowels?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
replace vowels - by niru - Sep-25-2017, 06:06 PM
RE: replace vowels - by ichabod801 - Sep-25-2017, 06:12 PM
RE: replace vowels - by haye - Sep-25-2017, 08:50 PM
RE: replace vowels - by nilamo - Sep-25-2017, 08:54 PM
RE: replace vowels - by ichabod801 - Sep-25-2017, 09:15 PM
RE: replace vowels - by haye - Sep-26-2017, 10:00 AM
RE: replace vowels - by metulburr - Sep-26-2017, 10:06 AM
RE: replace vowels - by haye - Sep-26-2017, 10:18 AM
RE: replace vowels - by buran - Sep-26-2017, 10:22 AM
RE: replace vowels - by nilamo - Sep-26-2017, 12:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  remove vowels in word with conditional ambrozote 12 4,233 May-02-2021, 06:57 PM
Last Post: perfringo
  counting vowels in a string project_science 3 2,617 Dec-30-2020, 06:44 PM
Last Post: buran
  Counting vowels in a string (PyBite #106) Drone4four 4 2,311 Jul-07-2020, 05:29 AM
Last Post: theknowshares
  Search & Replace - Newlines Added After Replace dj99 3 3,450 Jul-22-2018, 01:42 PM
Last Post: buran
  no vowels function alex_bgtv 6 5,109 Jan-01-2018, 08:48 PM
Last Post: alex_bgtv
  Vowels and Consonants detector OmarSinno 5 9,823 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