Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created May 13, 2017 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/809904d37cc0b63177c7336b3c19e5d9 to your computer and use it in GitHub Desktop.
Save codecademydev/809904d37cc0b63177c7336b3c19e5d9 to your computer and use it in GitHub Desktop.
Codecademy export
"""This program is designed to translate one word at a time into Pig Latin"""
pyg = 'ay'
original = raw_input('Enter a word:')
word = original.lower()
#When it mentions to include in "if" statement, it means after the colon but underneath the if statement. Just make sure it is indented with 4 spaces.
if len(original) > 0 and original.isalpha():
first = word[0]
new_word = word + first + pyg
print new_word[1:len(new_word)]
else:
print 'Invalid Format'
#This has been tested and works as designed. Hope this helps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment