Question: Define a function convert _ volume ( ) that has two parameters as the number of cups and fluid ounces. The function returns the volume

Define a function convert_volume() that has two parameters as the number of cups and fluid ounces. The function returns the volume converted to liters, given that:
1 fluid ounce =0.0295735 liters
1 cup =8 fluid ounces
Ex: If the input is:
2
166
then the output is:
5.382 liters LITERS_PER_FLUID_OUNCE =0.0295735
FLUID_OUNCES_PER_CUP =8
''' Your code goes here '''
num_cups = int(input())
num_fluid_ounces = int(input())
# Print with value rounded to 3 decimal places
print(f'{convert_volume(num_cups, num_fluid_ounces):.3f} liters')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!