Pyglatin 4. Check yourself


#1



print 'Welcome to the Pig Latin Translator!'

Start coding here!

original = raw_input("Enter a word:")
if len(original)> 0:
print "orginal"

print "empty"

Oops, try again. Did you remember to use if and else in your code?

Welcome to the Pig Latin Translator!
Enter a word: kill
orginal
empty
None


Replace this line with your code.


#2

i see an if, but i don't see an else?


#3

print 'Welcome to the Pig Latin Translator!'

Start coding here!

original = raw_input("Enter a word:")
if str("original")> 0:
print "original"
else:print "empty"

Oops, try again. The original variable ("hi") had more than 0 characters but did not get printed.

Welcome to the Pig Latin Translator!
Enter a word: hi
original
None


#4

using quotation marks around original makes it a string, you should use the variable original (without quotation marks), this contains the users input


#5

thank you
so much bro


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.