Function in Python that calculates discount on a price

def give_discount(fullprice, discountpc):
    discount = discountpc / 100 * fullprice
    askprice = fullprice - discount
    print(f"The actual price is {fullprice}, discount is {discountpc} percent, you give only {askprice}. Thanks.")

fullprice = int(input("Enter the actual price of the product plz: "))
discount = float(input("What percentage of discount you want to give?: "))

give_discount(fullprice, discount)
Python

Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

Making GUI Calculator in Tkinter Python

Unlocking Web Design: A Guide to Mastering CSS Layout Modes