Skip to content

Instantly share code, notes, and snippets.

@codecademydev codecademydev/ Secret
Created Mar 19, 2019

What would you like to do?
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
You can’t perform that action at this time.