[Solved] Python: 2.5.1 Painting a Wall


Maybe I am missing something here, but if 350 sq ft requires 1 gallon, then 250 sq ft will require 250/350 gallons. So you are being asked (I suppose) to request the area from the user and calculate the paint required for that area.

wall_area=float(input("How big is your wall in square feet? "))
gallons_paint = wall_area / 350
print(wall_area, 'square feet wall will need:')
print(gallons_paint, 'gallons of paint')

For example,

How big is your wall in square feet? 250
250.0 square feet wall will need:
0.7142857142857143 gallons of paint

Though you really ought to format the number to something sensible, as in

print(f'{gallons_paint:.2f} gallons of paint')

which will report

0.71 gallons of paint

With your other number, 576.6 square feet,

How big is your wall in square feet? 578.6
578.6 square feet wall will need:
1.65 gallons of paint

1

solved Python: 2.5.1 Painting a Wall