Kodewick
Start learning →
Starter←→0 / 80

Recipe, spelled out

#022StarterStrings3 min

Grandma's recipes are full of the short form tsp, and her granddaughter can't read them. Write spell_out(recipe) to change every tsp into teaspoon. With no tsp, return the recipe unchanged.

Examples
spell_out("1 tsp salt")→'1 teaspoon salt'
spell_out("2 tsp sugar, 1 tsp oil")→'2 teaspoon sugar, 1 teaspoon oil'
main.py
def spell_out(recipe):
    # your code here: use replace to swap tsp for teaspoon, and return it
    return recipe
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.