python - Why aren't my arguments being passed to the parameters? -
project dealing functions , making main function.
control rest of functions.
wall = 112 paint = 1 work = 8 premier = 20.50 generic = 10.75 labor_c = 12.75 print('welcome a&pm painting co. how may today?''\n') def paint_job(): space = float(input('what measurement of area' +\ ' want painted? ')) gallon(space) labor() paint_cost() labor_chrg() tot_cost()
all functions called
def gallon(space): global final final = space / wall print('\n''the gallons of paint required ' +\ 'job is', format(final, '.1f'),'gallons''\n') def labor(): global job job = final * work print('the hours of labor required this' +\ ' job is', format(job, '.1f'),'hours''\n') def paint_cost(): ask = input('would use premier or generic paint? ') if ask == "premier": prem_cost = final * premier print('the cost of paint total ' +\ 'to be', format(prem_cost, '.2f'),'dollars''\n') labor_chrg(prem_cost) else: gene_cost = final * generic print('the cost of paint total ' +\ 'to be', format(gene_cost, '.2f'),'dollars''\n') labor_chrg(gene_cost)
whether he/she wants premier or generic paint.
def labor_chrg(arg): paint_c = arg job = final * work l_charge = job * labor_c print('the charge of labor done total ' +\ 'to be', format(l_charge, '.2f'),'dollars''\n') tot_cost(paint_c, labor_c) def tot_cost(paint_c, labor_c): paint_c1 = paint_c labor_c1 = labor_c p_cost = final * paint_c1 l_charge = job * labor_c1 total = p_cost + l_charge print('the total cost of project requested ' +\ 'will be', format(total, '.2f'),'dollars''\n')
finished calculating total cost.
paint_job()
i having hard time trying figure out why args not being passed params properly. can tell me going wrong?
you need input these functions:
labor_chrg() tot_cost()
Comments
Post a Comment