I’m getting a TypeError: ‘>=’ not supported between instances of ‘float’ and ‘dict’ for this code. What’s wrong with it? [closed]

def transaction_successful(money_received, drink_cost):
    """Return True when payment is accepted, or false, if money is insufficient"""
    if money_received >= drink_cost:
        change = round(money_received - drink_cost, 2)
        print(f"Here is ${change} in change.")
        global profit
        profit += drink_cost
        return True
        print("Sorry that's not enough money. Money Refunded")
        return False

Read more here: https://stackoverflow.com/questions/66325424/im-getting-a-typeerror-not-supported-between-instances-of-float-and-di

Content Attribution

This content was originally published by Irfan Khan at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: