#Program 3 (100 points) In USA, each state has different rules for #license plates. In this program we will assume that all cars in #NJ have 6 digit number license plates, all cars in NY have 7 digit #number license plates , and all cars in RI have 4 or 5 digit #number license plates. Your program will read a number of cars in #the parking lot, license plate for each car, and finds the number #of cars from each of the 3 states listed above (NJ, NY, RI). #Write the following functions: #count_digit(num) - finds and returns the number of digits of #the parameter num. Assume that num is positive. #state(license_plate) - has one parameter - license plate. The #function returns 1, if the car from NJ, 2 - from NY, 3 - from RI. #This function will use function count_digit #parking(num_cars) - has one parameter, number of cars in the #parking lot. The function reads the license plate for each car in #the parking lot. The function finds and returns three values: the #number of cars from NJ, NY and RI. This function will use #function state to determine the state for each car #write main that reads the number of cars and finds the number #of cars from each of the 3 states listed above (NJ, NY, RI). #Pay attention: your input for license plate number could be ANY #POSITIVE INTEGER. And your program will ignore any numbers that #are shorter than 4 digits and longer than 7 digits since they #don't belong to any state. def count(num): counter=0 while(num>0): num=num//10 counter+=1 return counter #example: num=123 counter=0 123>0 True num=123//10=12 counter=1 #12>0 num=12//10=1 counter=2 #1>0 num=1//10=0 counter =3 #0>0 False loop is terminated def state(license_plate): length=count(license_plate) if(length==6): result=1 elif(length==7): result=2 elif(length==4 or length==5): result=3 return result def parking(num_cars): nj=0 ny=0 ri=0 for i in range(num_cars): plate=int(input("enter license plate ")) length=count(plate) if(length>=4 and length<=7): state_result=state(plate) if(state_result==1): nj+=1 elif(state_result==2): ny+=1 elif(state_result==3): ri+=1 return nj, ny, ri def main(): num_cars=int(input("parking lot size ")) nj, ny, ri= parking(num_cars) print("NJ", nj, "NY", ny, "RI", ri) main()