Monday, June 30, 2014

Day 86

Explored Python at CodeCademy. Worked on Python tutorial 4 of 11, PygLatin, Check Yourself! Worked with "if" and "else" commands.

The code used:
print 'Welcome to the Pig Latin Translator!'

original = raw_input("Enter a word:") 

if len(original) > 0:
    print original
    
else:
    print "empty"
    

The interaction for this code looked like this:
Welcome to the Pig Latin Translator!
Enter a word:
empty

also

Welcome to the Pig Latin Translator!
Enter a word: Pig
Pig

No comments:

Post a Comment