Saturday, July 5, 2014

Day 91

Python at CodeCademy. Worked on Python tutorial 9 of 11, PygLatin, Move it on Back! Worked on creating a new variable called "new_word" and set it equal to the concatenation of "word", "first", and "pyg".

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
else:
    print 'empty'

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

No comments:

Post a Comment