I have a list with [vehicle name, number]
a=[["car","A1"],["car","A2"],["truck","A1"]]
I need a function such that if i specify
car it should return "A2" the last number in that vehicle name. If i specify bike it should return "A0"
I tried writing something but keep getting an error list index out of range
EDIT:
here's the full list format
["vehicle","color","vehicle_num","status(True/False)","code"]
vehicle and color is given and last vehicle_num should be found, if vehicle,color doesn't exist return "A0"
The number system starts from "A1",.........."An"
n varies according to the vehicle,color
list is already sorted