Help with Check Yourself... Some More


#1



Check Yourself... Some More

Apparently my input string gets printed even if the input values contains letters and numbers

I expected the input "joshi 106" to work. Where am I going wrong

Here's my code.

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input("Enter a word:")
print original
if len(original) > 0 and original.isalpha():
    print original
else :
    print "empty".

Many thanks!


#2
print "empty" .  #see the .

remove that .


#3

@rcodeman

my original code doesn't have the "."

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input("Enter a word:")
print original
if len(original) > 0 and original.isalpha():
    print original
else :
    print "empty"

thank you


#4

your code is just fine.what's the error meassage ?

did you press ENTER after typed input value?

reload your page(may be slove your problem) .


#5

This is why it is printing regardless of input. The print is before the validation test.


#6

here's the error message

"Oops, try again. It looks like your code prints original ("amol 106") when original includes non-alphabetical characters"

Yes I did press ENTER.
Yes I reloaded the page.


#7

Here's the error message.


#8

original shouldn't be printed if there are non alpha numeric characters in it. remove the print of line 5, this will print original even if there are non alpha numeric characters

mtf already tried to tell you this


#9

stetim94 mtf and rcodeman,

THANK YOU. IT WORKS!!!!


#10