For some reason my code assigns the variables but then they change to their original value. (And I don't get any errors)
And the only time I change them is in check_database() I would really appreciate anyone who comments on this post.
CarNumbers = [
    {"number":"ABC 123", "oil":"10"},
    {"number":"ABC 124", "oil":"11"},
    {"number":"ABC 125", "oil":"12"}
]
IsValidCarNumber = False;
#this variable doesent work
TemporaryCarNumber = "";
#and this variable doesn't work too
TemporaryCarOil = 1;
def check_database(msg):
    for i in CarNumbers:
        if i["number"] == msg:
            #here I assign them
            TemporaryCarNumber = i["number"]
            TemporaryCarOil = i["oil"]
            return True
    return False
def make_reply(msg, validNumber):
    reply = None
    if msg is not None:
        if validNumber:
            #and here the variable doesn't work
            reply = "valid number!! Number:" + str(TemporaryCarNumber) + ", Oil:" + str(TemporaryCarOil)
        else:
            reply = "not valid number!"
        validNumber = False;
    return reply
update_id = None
while True:
    updates = bot.get_updates(offset=update_id)
    updates = updates["result"]
    if updates:
        for item in updates:
            update_id = item["update_id"]
            try:
                message = str(item["message"]["text"])
            except:
                message = None
            from_ = item["message"]["from"]["id"]
            valid = check_database(message)
            reply = make_reply(message, valid)
            bot.send_message(reply, from_)
 
    