vendredi 15 mai 2015

Need help on programming

whenever I run this code it comes up with a logical error, I'm trying to get each separate part of the cars registration plate and see if its valid, but nothing prints whenever I run this in Python 3.3

cars = {"RU13 BUM":[1429877911, 1429880085], "VHY5 IBT":[1430143959, 1430144979], "Ka11 XII": [1430150667, 1430152678], "RA10 BAB": [1430500934, 1430501397]}

def regFormatChecker():
    if len(cars) == 8:
        for reg, times in cars.items():
            formatCheck = cars[:2].isaplha()
            if formatCheck == True:
                print ("The first two charcters are correct")
            elif formatCheck == False:
               print ("The first two characters are incorrect, you are not using the standard UK regestration plate")
            formatCheck = cars[2:4].isdigit()
            if carsformatCheck == True:
                print ("The second two characters are correct")
            elif carsformatCheck == False:
                print ("The second two characters are incorrect, you are not using the standard UK regestration plate")
            formatCheck = cars[4] == " "
            if formatCheck == True:
                print ("The next character is correct")
            elif formatCheck == False:
                print ("The next character is incorrect, you are not using the standard UK regestration plate")
            formatCheck = cars[4:8].isalpha()
            if formatChecker == True:
                print ("The last three characters are correct, you are using a standard UK regestration plate")
            elif formatCheck == False:
                print("The last three characters are incorrect, you are not using a standard UK regestration plate")

Aucun commentaire:

Enregistrer un commentaire