-2

I need to replace certain letters in a word with a character.

I'm stuck. How can I fix it?

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Dude
  • 11
  • 1

1 Answers1

3

It looks like you already have most of the code. You just need to add the letters that don't need to be replaced and are not in the consonants list.

To do this, I would use an if-else instead of an if in your loop. This will allow you to replace letters that are in the consonants list and add letters that don't need to be replaced to the final word. It would look something like this: new scratch code

Note that the consonants list has the characters that are to be replaced in word word.

This should give you what you are looking for.

flyingbyte
  • 79
  • 5