处理功能和制作主要功能的项目。
控制其余功能。
wall = 112
paint = 1
work = 8
premier = 20.50
generic = 10.75
labor_c = 12.75
print('Welcome to A&PM Painting Co. How may we help you today?''\n')
def paint_job():
space = float(input('What is the measurement of the area' +\
' you want painted? '))
gallon(space)
labor()
paint_cost()
labor_chrg()
tot_cost()
所有称为
的函数def gallon(space):
global final
final = space / wall
print('\n''The gallons of paint required for the ' +\
'job is', format(final, '.1f'),'gallons''\n')
def labor():
global job
job = final * work
print('The hours of labor required for this' +\
' job is', format(job, '.1f'),'hours''\n')
def paint_cost():
ask = input('Would you like to use premier or generic paint? ')
if ask == "premier":
prem_cost = final * premier
print('The cost of the paint will total up ' +\
'to be', format(prem_cost, '.2f'),'dollars''\n')
labor_chrg(prem_cost)
else:
gene_cost = final * generic
print('The cost of the paint will total up ' +\
'to be', format(gene_cost, '.2f'),'dollars''\n')
labor_chrg(gene_cost)
他/她是否需要高级或通用油漆。
def labor_chrg(arg):
paint_c = arg
job = final * work
l_charge = job * labor_c
print('The charge of the labor done will total up ' +\
'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 the project you requested ' +\
'will be', format(total, '.2f'),'dollars''\n')
完成了总费用的计算。
paint_job()
我很难弄清楚为什么我的args没有被正确传递给params。谁能告诉我出了什么问题?
答案 0 :(得分:0)
您需要在这些功能中输入内容:
labor_chrg()
tot_cost()