PY
py
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
# This is a simple language game called Pig Latin
# For more information on the rules of the game, please see https://en.m.wikipedia.org/wiki/Pig_Latin
x=str(input())
vowel=["a","e","i","o","u"]
# Removing symbols and numbers from the string
def clean(w):
cleaned=str("")
for i in w:
if i.isalpha():
cleaned=cleaned+i
return(cleaned)
# Applying the game rules to each word
def word(a):
a=clean(a)
b=a
for i in range(len(a)):
if a[i] in vowel:
break
b=(b[1:])+a[i]
return b+"ay"
# Running the code on all words in the string
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run