by CodeChum Admin
Now that we're done with integers, we're moving on to decimals!
Instructions:
Instructions
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
#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)
Comments
Leave a comment