Forked from mayankdawar/accumConditionalPattren_2.py
Created
December 17, 2021 03:19
-
-
Save simrit1/5aa55e733c39924c147ff216b0236c76 to your computer and use it in GitHub Desktop.
Challenge 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.
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
| words = ["adopt", "bake", "beam", "confide", "grill", "plant", "time", "wave", "wish"] | |
| past_tense = [] | |
| for i in words: | |
| if(i[len(i)-1] == 'e'): | |
| i += 'd' | |
| else: | |
| i += 'ed' | |
| past_tense.append(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment