Check Yourself... Some More Problem


#1

print 'Welcome to the Pig Latin Translator!'

original = raw_input("Enter a word:")

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

Oops, try again. Did you remember to use .isalpha() in your code?

I don\t understand what\s wrong with the code..


#2

When using OR, the first True will short-circuit the expression. Since the string has some length, the second condition is not tested. Use AND so both conditions MUST be True, and both get checked.


#3

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