Search code examples
pythonpaint

Zybook - paint challenge python


Scenario: Finish the program to compute how many gallons of paint are needed to cover the given square feet of walls. Assume 1 gallon can cover 350.0 square feet. So gallons = the square feet divided by 350.0. If the input is 250.0, the output should be: 0.714285714286 ____________________________________-

gallons_paint = 0.0

wall_area = float(input())

# Assign gallons_paint below

''' Your solution goes here '''

print(gallons_paint)

I've been trying different combinations and I can't figure out how to get the float right. Any help would be appreciated! :)


Solution

  • Assuming wall_area is a floating point number, it's simple:

    gallons_paint = wall_area / 350