Advertisement
Guest User

final piglatin

a guest
Dec 5th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. text=raw_input("What would you like to translate?")
  2. list=text.split()
  3. translation=""
  4. for word in list:
  5.     pyg = 'ay'
  6.     original = word
  7.     if len(original) > 0 and original.isalpha():
  8.         word = original.lower()
  9.         first = word[0]
  10.     else:
  11.         print 'empty'
  12.     if first == "a" or first == "e" or first == "i" or first == "o" or first == "u":
  13.         new_word = word + "w" + pyg
  14.     else:
  15.         new_word = word + first + pyg
  16.     new_word = new_word[1:len(new_word)]
  17.     translation=translation+new_word+" "
  18. print translation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement