How can I check the length of the user’s input?

Hi there,

I was wondering the same as pujasudhakaran7589 and sickmofotriple. If the user just types the spacebar the program just print them again. I don’t know how to differentiate the spaces from the actual characters in the “original” string.

If anyone knows please, it would be a great help.

Thank you all!

That is where isalpha() comes in. It won’t allow space characters, only alphabet letters (think alphabet soup).

Thank you mtf :blush:
I just realise that in the next step of the course it is solved with this .isalpha() function. Thank you anyway :slight_smile: :relaxed:

1 Like