raw_input("Enter a word:") original = raw_input print original empty_string = "" if len(original) > 0 and original.isalpha(): print original else: print "empty" Why is this wrong ? I don't get why I am supposed to write len(empty_string) and can't write len(original)
if len(empty_string) > 0 and original.isalpha(): it had to be like this. I don't understand why I need to create the other variable empty_string and can't just reference to the variable original to check either whether the user's word is empty or there are numbers.
thats because you never needed to create it. you still need to use the original but in yor code you have original as a function(not a string) and the len() function expects an iterable(string, list etc) to be passed as argument. to fix that you need to merge these two lines into one