I am at the very beginning of my programming course (career change) so bear with me if this is simple. I am trying to check if the users input contains numbers in the middle of the string, as they must come at the end. E.g XXX55 is valid, XXX5X is not valid.
s = input("Plate: ").upper()
for i in s:
if i.isdigit():
if i+1.isalpha():
print("Invalid")
This is what I tried but it doesn’t work I want it to check if each character is a digit and if if its true then check if the next character is an alphabet.
New contributor
user24897552 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.