Skip to content

Commit

Permalink
Merge pull request #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

2 comments on commit e414d6b

@gaurav-91
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They tell what was the content added compared to old code. So here all the + says those lines were newly added.other than that it does not do anything

@marcosrdac
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh... I'm new here. Thanks xD

Please sign in to comment.