Skip to content

Commit

Permalink
Merge pull request karan#44 from gaurav-91/patch-2
Browse files Browse the repository at this point in the history
Update piglatin.py
  • Loading branch information
Karan Goel committed Apr 14, 2014
2 parents 292fabb + 5d378c7 commit e414d6b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Text/piglatin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,26 @@

pig = 'ay'

consonant = []
count = 0
copy = [c for c in word]

for i in range(len(copy) - 1):
count = i
if copy[i] in vowels:
break
else:
consonant.append(copy[i])

new = word[count:] + "".join(consonant) + pig

"""
first = word[0]
if first in vowels:
new = word + pig
else:
new = word[1:] + first + pig
"""

print new

0 comments on commit e414d6b

Please sign in to comment.