Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. print("Pig Latin Translator Test!")
  2. name = raw_input("What is your name?")
  3. if len(name) > 0 and name.isalpha():
  4. print("Hello!")
  5. else:
  6. print("That's not a name!")
  7. word = raw_input("What is your word?")
  8. word0 = word[0]
  9. word0 = word0.lower()
  10. n = 0
  11. if len(word0) > 0 and word0.isalpha():
  12. word0proof = word0
  13. else:
  14. print("That isn't a word!")
  15. if word0proof in "aeiou":
  16. wordoutput = word + "yay"
  17. print wordoutput
  18. else:
  19. print("Your word doesn't begin with a vowel")
  20. if word0proof in "bcdefghjklmnpqrstvwxyz":
  21. word1 = word0proof
  22. else:
  23. word0proof = word0proof
  24. #Now get word1 to move all consonants to the back of the word and add "ay"
  25. while word1 in "bcdefghjklmnpqrstvwxz":
  26. word1 = word[n:] + word0 + "ay"
  27. n = n + 1
  28. print word1
  29. word1 = word1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement