# Write a function good_string that consumes a string, produces True if the first character is a
# letter and the second character is either a digit or a blank space and produces False
# otherwise
# A function that consumes a string and outputs True if the first
# character is a letter and the second is either a digit or a space
# and outputs False otherwise.
def good_string():
user_input = str(input("Enter the string you need checked: \n"))
answer = "False"
if user_input[0].isalpha():
if user_input[1].isnumeric() or user_input[1] == " ":
answer = "True!"
else:
answer = "False!"
else:
answer = "False!"
print(answer)
good_string()
Comments
Leave a comment