Advertisement
N4rCochaos

Untitled

Nov 2nd, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. #!/usr/bin/env
  2.  
  3. pyg = 'ay'
  4.  
  5. pyg_input = raw_input("Digite a palavra a ser traduzida: ")
  6. print
  7.  
  8. if len(pyg_input) > 0:# and pyg_input.isalpha():
  9.     lwr_input = pyg_input.lower()
  10.     lst = lwr_input.split()
  11.     latin = []
  12.     for item in lst:
  13.         frst = item[0]
  14.         if frst in 'aeiou':
  15.             item = item + pyg
  16.         else:
  17.             item = item[1:] + frst + pyg
  18.         latin.append(item)
  19.     print ''.join(latin)
  20.     print "Pig Latin"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement