Python : Console Question


#1

I was writing this code for the Pyg Latin Convertor and something occured to me.

As you can see in the first image,when I entered some string without a space in the console, the program accepted the input.But as you can see in the second image when entered the same string with a space in between it prints the else section of the code.Does this happen due to the use of .isalpha() method? And if yes then why so?
Thank You!!


#2

spaces are not alphanumeric characters.

If i where you, i would enter the space here:

raw_input("Enter a word: ")

so the user doesn’t have to.


#3

Thank you for the help!