Skip to content

Instantly share code, notes, and snippets.

@Alexpeain
Last active December 18, 2020 16:08
Show Gist options
  • Save Alexpeain/cda29f7df3f43579f679e6910ed6b2d5 to your computer and use it in GitHub Desktop.
Save Alexpeain/cda29f7df3f43579f679e6910ed6b2d5 to your computer and use it in GitHub Desktop.
For each word in words, add ‘d’ to the end of the word if the word ends in “e” to make it past tense.
Otherwise, add ‘ed’ to make it past tense. Save these past tense words to a list called past_tense.
words = ["adopt", "bake", "beam", "confide", "grill", "plant", "time", "wave", "wish"]
past_tense = 0
for i in words:
if i in ['bake','confide','time','wave']:
past_tense = i + "d"
else:
past_tense = i + "ed"
print(past_tense)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment