I am taking a intro to computer programming class and in it we use python.
My assignment is to Write a program named paint.py that will determine the cost of painting the walls of a shed with a rectangular floor. Assume the shed has no windows and that paint costs $40 per gallon. One gallon covers 300 square feet. Prompt the user to enter the dimensions of the shed. Use a function named paint_cost that takes the user inputs as arguments and returns the cost of painting the walls of the shed. Express the cost in currency format.
I have tried really hard on thinking how to do it. I have researched and read the chapter over and over again in my python book. So if anyone can please help me.
def paint_cost(price):
return (dimen / 300) * 40
def main():
dimen = input('Enter the dimensions of the shed: ')
print('Your cost of painting will be $', paint_cost(price))
main()
NameError: name 'price' is not defined.pricequite obviously isn't defined anywhere, and is probably not meant to be a function. (This, by the way, is exactly why you should post the actual error message, not just describe it.)retunnot being defined, because that typo happens to make your return statement look like an expression with a call to a function namedretunin it…retun