Skip to content

Instantly share code, notes, and snippets.

@ssorgatem
Created August 22, 2017 12:43
Show Gist options
  • Select an option

  • Save ssorgatem/9099d42400f843114336daf84ce76b38 to your computer and use it in GitHub Desktop.

Select an option

Save ssorgatem/9099d42400f843114336daf84ce76b38 to your computer and use it in GitHub Desktop.
random_vowels.py
import random
from unidecode import unidecode
vowels = "aeiouyw"
sentence = unidecode(input())
new_sentence = ""
for i, c in enumerate(sentence.lower()):
if c in vowels:
new_c = random.choice(vowels)
else:
new_c = c
if sentence[i].isupper():
new_c = new_c.upper()
new_sentence += new_c
print(new_sentence)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment