Write a python statement for the following. Assigns the product of 10 and 15 to the variable product. Then Subtracts the variable down_payment from the variable total and assigns the result to the variable due. And Multiplies the variable subtotal by 0.15 and assigns the result to the variable total. Then Prompts the user to enter his or her favorite color and assigns the user’s input to a variable named color.and Assume the variable sales references a float value 56.3355. Round the value to two decimal points.
# (a)
prod=10*15
print('The product of the number is:',prod)
#(b)
total=1000
down_payment = 300
due = total - down_payment
print('The due payment is:',due)
# (c)
subtotal=200
total = subtotal * 0.15
print('total calucation is:',total)
#(d)
color = str(input("Enter your favourite color? "))
print('The favourite color of the person is:',color)
#(e)
sales=3.467
print('The round figure value is:',round(sales,2))
Output:
Comments
Leave a comment