SHARE
TWEET

Untitled

a guest Jul 17th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys
  2. import re
  3.  
  4.  
  5. def past_verb(s):
  6. #    print(s[-1])
  7.     if s[-1]  ==  "y":        
  8.         return s + "ed"
  9.     elif s[-1] =="ry":
  10.         return s[:-2] + "ied"
  11.     elif s[-1] == "e":
  12.         return s  + "d"
  13.     elif s[-1] == "p":
  14.         return s + "ped"
  15.     elif s[-1] == "c":
  16.         return s + "ked"
  17.     elif s[-1] == "o":
  18.         return s + "ne"
  19.     elif s == "put":
  20.         return s
  21.     else:
  22.         return s + "ed"
  23. if __name__ == '__main__':
  24.     print(past_verb("play"))
  25.     print(past_verb("try"))
  26.     print(past_verb("like"))
  27.     print(past_verb("stop"))
  28.     print(past_verb("picnic"))
  29.     print(past_verb("go"))
  30.     print(past_verb("put"))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top