Sunday, July 6, 2014

Day 92



Python at CodeCademy. Worked on Python tutorial 10 of 11, PygLatin, Ending Up! Worked on learning to slice a string.

The code used:
pyg = 'ay'

original = raw_input('Enter a word:')

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

The interaction for this code looked like this:
Enter a word: Piggy
Piggy

No comments:

Post a Comment