I have two columns, which are unit price and quantity (through input by user) and I have to multiply them together to get the total price.
price="{:0.2f}".format(float(input("Enter price: ")))
quantity=int(input("Enter quantity: "))
print("Enter expired date: ")
year = int(input('Enter a year'))
month = int(input('Enter a month'))
day = int(input('Enter a day'))
expired_date = datetime.date(year, month, day)
df1 = pd.DataFrame(data=[[name,price,quantity,expired_date,today<=expired_date]],columns=["Name","Unit Price","Quantity","Expiry Date","Expired?"])
df = df.append(df1,ignore_index=True)
**df['Price'] = (df["Quantity"]*(df["Unit Price"]))**
df["Expired?"] = df["Expired?"].replace({True: 'Yes', False: 'No'})
However, the result I get is as follows:
Unit Price Quantity Price
2.00 2 2.002.00
What is the solution for this?