Lab 4

Lab Description:  I  was  assigned  to  complete  “PygLatin”  from  codeacademy.  It  had  requested  that  I  write  a  code  that  involves  a  larger  amount  of  knowledge  than  my  last  lab.

Code:

pyg = 'ay'
original = raw_input('Enter a word:')
if len(original) > 0 and original.isalpha():
    word = original.lower()
    first = word[0]
    if first in "aeiou":
        new_word= str(word)+str(pyg)
        print new_word
    else:
        new_word= word[1:] + word[0] + pyg
        print new_word
else:
    print 'empty'

Screenshots:

Lab4

Leave a Reply

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