Skip to content

Instantly share code, notes, and snippets.

@les-peters
Created June 13, 2022 20:25
Show Gist options
  • Save les-peters/8bcc5f49f4b583029d9b7e7802f4565e to your computer and use it in GitHub Desktop.
Save les-peters/8bcc5f49f4b583029d9b7e7802f4565e to your computer and use it in GitHub Desktop.
Long Text Generator
question = """
Create a loooong teeeext generator that takes in a string and an integer n,
and multiplies the vowels in the string by n.
Example:
$ longText('hello world', 3)
$ 'heeellooo wooorld'
$ longText('lol', 10)
$ 'looooooooool'
"""
import re
def longText(string, x):
string = re.sub(r'([aeiou])', r'\1' * x, string)
print(string)
return
longText('hello world', 3)
longText('lol', 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment