Answer to Question #261398 in Python for Mika

Question #261398

4. Decimal x Decimal

by CodeChum Admin

Now that we're done with integers, we're moving on to decimals!


Instructions:

  1. Input three decimal numbers with only two decimal places in one line separated by spaces, store them inside variables.
  2. Multiply the 1st and 2nd decimal numbers, store the product.
  3. Divide the product of the 1st and 2nd decimal numbers with the 3rd decimal number, then print out the quotient with only two decimal places.

Instructions

  1. Input three decimal numbers with only two decimal places in one line separated by spaces, store them inside variables.
  2. Multiply the 1st and 2nd decimal numbers, store the product.
  3. Divide the product of the 1st and 2nd decimal numbers with the 3rd decimal number, then print out the quotient with only two decimal places.

Input

A line containing three decimal numbers with two decimal places separated by a space.


1.53·2.25·1.23

Output

A line containing the result with two decimal places.


2.80
1
Expert's answer
2021-11-05T00:34:19-0400
#Getting Input from the User
first_dec = float(input("Please enter the first decimal: "))
second_dec = float(input("Please enter the second decimal: "))
third_dec = float(input("Please enter the third decimal: "))


#Multiplying the first and second decimals
product= first_dec * second_dec


#Here is the final answer is stored in final
final = "{:.2f}".format(product / third_dec)


print(final)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS