You don't need the
has_chars function. Simply check whether the
0. Also note that
the_string is undefined. Accordingly, this ...
if has_chars(original) and the_string.isalpha():
... should be ...
if len(original) > 0 and original.isalpha():
However, if you have created the
has_chars function for the purpose of practicing writing functions, and wish to pursue that purpose, you could do this to call the function ...
if has_chars(original) and original.isalpha():
However, now you must get the function to work properly. Provide it with a parameter, then test the
len of that parameter inside the function. Instead of
printing the result,
False, as follows ...
if len(word) > 0:
That could be simplified to ...
return len(word) > 0
You could instead write a function that does all the checking ...
return len(word) > 0 and word.isalpha()
Also note that an advisable way to use the
raw_input function is to call it and assign the result to a variable. You can do that in one line, as follows ...
original = raw_input("Enter a word: ")