Lab 4: Pyglatin

Description:

In this lab we learned how stings can be connect to us using pyglatin. When using pyglatin we came up with a code that looks like the screenshot. Pyglatin was very difficult then all the other labs and it can be difficult to understand but it teaches you many more things that you can do in python.

Source Code:

pyg = ‘ay’

original = raw_input(‘Enter a word:’)
word = original.lower()
first = word[0]
new_word = word[2:] + first + pyg
if len(original) > 0 and original.isalpha():
if first == “a” or first == “e” or first == “i” or first == “o” or first == “u”:
new_word= word + pyg
print new_word

else:
new_word = word[1:] + first + pyg
print new_word
else:
print ’empty’

Screenshot:

kevin pyglatin

Leave a Reply

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