Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created March 19, 2019 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/977a4d0c4fb7351c4585fdbdfa3e9e8e to your computer and use it in GitHub Desktop.
Save codecademydev/977a4d0c4fb7351c4585fdbdfa3e9e8e to your computer and use it in GitHub Desktop.
Codecademy export
# Write your make_spoonerism function here:
def make_spoonerism(word1, word2):
string = (word1.replace(word1[0], word2[0])) + " " + (word2.replace(word2[0], word1[0]))
return string
# Uncomment these function calls to test your function:
#print(make_spoonerism("Codecademy", "Learn"))
# should print Lodecademy Cearn
#print(make_spoonerism("Hello", "world!"))
# should print wello Horld!
#print(make_spoonerism("a", "b"))
# should print b a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment