Created
September 6, 2021 20:00
-
-
Save joan0fsnark/065bce88d7942cc5a65bd8eaa9d6c7f2 to your computer and use it in GitHub Desktop.
Takes in two words and returns the two with first letters swapped
This file contains hidden or 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): | |
return word2[0] + word1[1:]+" "+word1[0] + word2[1:] | |
# 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