-
-
Save codecademydev/977a4d0c4fb7351c4585fdbdfa3e9e8e to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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