Lab 4: Piglatin

Lab description:

In this lab we got a better understanding on loops if/else statements and boolean expressions.

Codes:

pyg = ‘ay’

original = raw_input(‘Enter a word:’)

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
new_word = word+first+pyg
new_word = new_word[1:len(new_word)]
print new_word
else:
print ’empty’

Screenshot:

Screen Shot 2015-03-12 at 6.07.08 PM

Leave a Reply

Your email address will not be published. Required fields are marked *