#Rate my code

10 messages · Page 1 of 1 (latest)

obtuse drum
#

Rate my game's code

#
food = []

def Discount(**kwargs):
    price = kwargs.get("price", 0)
    discount_price = price * 0.10
    amount = price - discount_price
    print(f"Discounted price: ₹{amount:.2f}")

def Tax(**kwargs):
    price = kwargs.get("price", 0)
    tax_amount = 2.65
    total = price + tax_amount
    print(f"Total after tax: ₹{total:.2f}")

while True:
    name = input("Enter your food (Q to quit): ")
    if name.upper() == "Q":
        break

    if not name.strip():
        print("Invalid name. Try again.")
        continue

    try:
        price = int(input(f"Enter {name}'s price: ₹"))
    except ValueError:
        print("Price must be a number.")
        continue

    food.append((name, price))

    if price > 500:
        Discount(price=price)
    else:
        Tax(price=price)


print("\n🧾 Final Invoice:")
for item in food:
    print(f"- {item[0]}: ₹{item[1]}")
maiden shoal
#

Yandere sim dev be like

#

What are kwargs for if u use only 1 argument

blissful apex
blissful apex
maiden shoal
#

Dunno havent analyzed lmao

blissful apex
obtuse drum
#

Happy to know mistakes to fix them!