Wednesday, December 18, 2019

car registration number

import string

import random



def register_car_number():

    alphabet = list(string.ascii_uppercase)

#     ["A","B",....,"Z"]

    

    letter1 = alphabet[random.randint(0,26)]

    letter2 = alphabet[random.randint(0,26)]

    letter3 = alphabet[random.randint(0,26)]

    

    num1 = random.randint(0,9)

    num2 = random.randint(0,9)

    num3 = random.randint(0,9)

    



    month = input("Please enter the month the car is made ")

    year = input("Please enter the year the car is made ")



    car_number = letter1 + letter2 + letter3 +" " + month + " " + year + " "+ str(num1) + str(num2) + str(num3)

    print("Here is your car registeration number: ", car_number )



    

    

register_car_number()



    

No comments:

Post a Comment