def gaPlate( plateStr ):
if len( plateStr) > 7:
print("DEBUGGING: Length is too long")
return False
for c in plateStr:
if c not in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ":
return False
if c.isalpha() == False and c.isdigit() == False and c != ' ':
return False
return True
def main():
plates = ["Hello", "Hello!", "Python", "python", "in2itive", "-CSHFLW", "UNDRCOVER", "in2itve", " Hi ", " Hi "]
for plate in plates:
valid = gaPlate( plate)
print(plate, "is a valid GA license plate:", valid)
if __name__ == "__main__":
main()