Question: Write Python code that validates a string. Your program should: Read a string text from the user. Loops through the characters of text: Check if
Write Python code that validates a string.
Your program should:
- Read a string text from the user.
- Loops through the characters of text:
- Check if all non-space (" ") characters are alphabet characters (a to z, A to Z)
- If all are valid, display "The input is valid"
- Otherwise, display "The input is invalid"
- no built-in functions to test characters types like isalpha(), isspace()
- Check if all non-space (" ") characters are alphabet characters (a to z, A to Z)
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
