Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Pig Latin Translator Test!")
- name = raw_input("What is your name?")
- if len(name) > 0 and name.isalpha():
- print("Hello!")
- else:
- print("That's not a name!")
- word = raw_input("What is your word?")
- word0 = word[0]
- word0 = word0.lower()
- n = 0
- if len(word0) > 0 and word0.isalpha():
- word0proof = word0
- else:
- print("That isn't a word!")
- if word0proof in "aeiou":
- wordoutput = word + "yay"
- print wordoutput
- else:
- print("Your word doesn't begin with a vowel")
- if word0proof in "bcdefghjklmnpqrstvwxyz":
- word1 = word0proof
- else:
- word0proof = word0proof
- #Now get word1 to move all consonants to the back of the word and add "ay"
- while word1 in "bcdefghjklmnpqrstvwxz":
- word1 = word[n:] + word0 + "ay"
- n = n + 1
- print word1
- word1 = word1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement