Skip to content

Commit 7693d42

Browse files
author
Karan Goel
committed
Pig Latin done
1 parent 0626902 commit 7693d42

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Text/piglatin.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
Pig Latin - Pig Latin is a game of alterations played
3+
on the English language game. To create the Pig Latin
4+
form of an English word the initial consonant sound is
5+
transposed to the end of the word and an ay is affixed
6+
(Ex.: "banana" would yield anana-bay). Read Wikipedia
7+
for more information on rules.
8+
"""
9+
10+
word = raw_input('What\'s your word? ').lower()
11+
vowels = 'aeiou'
12+
13+
pig = 'ay'
14+
15+
first = word[0]
16+
17+
if first in vowels:
18+
new = word + pig
19+
else:
20+
new = word[1:] + first + pig
21+
22+
print new

0 commit comments

Comments
 (0)