Menu
Coddy logo textTech

Past Tense

Lesson 19 of 19 in Coddy's Into the Past || Complete Beginner for Python Strings course.

Transform a word to the past tense of that word.

challenge icon

Challenge

Easy

Create a function which adds an "ed" to a string if it does not already end with "ed"


Example:

Input - "stay"

Expected Output - "stayed"

Input - "jumped"

Expected Output - "jumped"

You are going to build on everything you have done up until now.  In that first case we added "ed" to "stay"

In the second we return the string with no additions need 

Try it yourself

def past(s):
    #write your code below
    

All lessons in Into the Past || Complete Beginner for Python Strings