5/11 Why is isalpha() not working?


Here is my code. The isalpha() check does not work - the code still prints my original word even if the word includes numbers.

I have looked at similar questions from other people on this forum and I just cannot see what is wrong with my code. Help?

(and yes, I remembered the indents - they just don't show up here.)

original = raw_input("Enter a word:")
print original
if (len(original) > 0) and original.isalpha():
print original
print "empty"


It works for me, try refreshing your webbrowser.


Tried refreshing. Still doing the same thing. The empty check doesn't work either, I just realized. Original still prints.



print original


if blablabla


This seems to have fixed it! Thank you. Why does it carry the code over from previous lessons if they block progress??


They don't block progress, they build up, you'll see that more in the future.

If solved, click solve and like, happy coding! :smile:


could some one add the correct code mine doesnt work at all


This is what I wrote, working good :-). Please indent ( as required )
def if_eng():
word = raw_input("Enter word:\n")
if word.isalpha():
print word[1:] + word[0] + "ay"
print "Enter valid word"


Hi everyone, I'm new to this and I need some help for the next task. Can anybody be kind enough to help?