# gaPlate() tests if the argument is a valid GA license plate.
# Return True iff it meets all criteria
def gaPlate( plateStr ):
    # Be up to 7 characters (including spaces).
    if len( plateStr) > 7:
        print("DEBUGGING: Length is too long")
        return False

    # Can contain letters, numbers, and spaces.
    #if plateStr.isalpha() or plateStr.isdigit() or plateStr == ' ':
    # for i in range(len(plateStr)):
    #     c = plateStr[i]
    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()