Skip to content

Instantly share code, notes, and snippets.

@ZechCodes
Created January 16, 2021 01:35
Show Gist options
  • Save ZechCodes/853caf3547707fb7ec7d8d0b934cfb63 to your computer and use it in GitHub Desktop.
Save ZechCodes/853caf3547707fb7ec7d8d0b934cfb63 to your computer and use it in GitHub Desktop.
Challenge 166 - Scottish Screaming

Challenge 166 - Scottish Screaming

A strong Scottish accent makes every vowel similar to an "e", so you should replace every vowel with an "e". Additionally, it is being screamed, so it should be in block capitals.

Create a function that takes a string and returns a string.

Examples

to_scottish_screaming("hello world") ➞ "HELLE WERLD"

to_scottish_screaming("Mr. Fox was very naughty") ➞ "MR. FEX WES VERY NEEGHTY"

to_scottish_screaming("Butterflies are beautiful!") ➞ "BETTERFLEES ERE BEEETEFEL!"

Notes

  • Make sure to include all punctuation that is in the original string.
  • You don't need any more namespaces than are already given.
import unittest
def to_scottish_screaming(words: str) -> str:
return "" # Put your code here!!!
class Test(unittest.TestCase):
def test_1(self):
self.assertEqual(to_scottish_screaming("lorem ipsum"), "LEREM EPSEM")
def test_2(self):
self.assertEqual(to_scottish_screaming("Leeroy jenkins!"), "LEEREY JENKENS!")
def test_3(self):
self.assertEqual(
to_scottish_screaming("A, wonderful, day, don't, you, think?"),
"E, WENDERFEL, DEY, DEN'T, YEE, THENK?",
)
def test_4(self):
self.assertEqual(to_scottish_screaming("Hello world"), "HELLE WERLD")
def test_5(self):
self.assertEqual(
to_scottish_screaming("start queueing you oafs"), "STERT QEEEEENG YEE EEFS"
)
if __name__ == "__main__":
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment