-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPigLatin1.py
More file actions
37 lines (32 loc) · 938 Bytes
/
Copy pathPigLatin1.py
File metadata and controls
37 lines (32 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Translating any word into Pig Latin!
#Rules: Move the first letter of the word to the end and then append ay'.
#Example: python -> ythonpay
vokale = ["a", "e", "i", "o", "u"]
runde = True
while runde:
vokvorh = False
original = raw_input('Get ready to start translating to Pig Latin!\nEnter a word: ')
word = original.lower()
if len(original) > 0 and original.isalpha():
for i in range (0 , len(vokale)):
if (word[0] == vokale [i]):
new_word = word + "ay"
print (original)
print (new_word)
vokvorh = True
else:
i = i + 1
if vokvorh == False:
new_word = word[1:len(word)] + word[0] + "ay"
print (original)
print (new_word)
else:
print ('empty')
print "\nTry again? [y] oder [n]"
#Entscheidung und Zulaesige Zeichen einschraenken
while runde not in ("y", "n"):
runde = raw_input()
if (runde == "n"):
runde = False
else:
runde = True