我正在為一名推銷員開(kāi)發(fā)一個(gè) Python 項(xiàng)目。該項(xiàng)目根據(jù)每周的工作時(shí)間和每周銷售傭金的百分比計(jì)算工資,并將它們加在一起得到銷售員的每周總工資。我遇到的問(wèn)題是將銷售額除以他們從每次銷售中獲得的百分比。錯(cuò)誤是“無(wú)法分配給操作員”#Prompt user for the number of hours worked that week hours_worked = int(input("How many hours did you work this week? \n"))#Define hourly wageper_hour = 30#Multiply the hourly wage and hours worked that weektotal_hours_pay = hours_worked * per_hour#Prompt user for the number of sales made that weeksales_made = int(input("How many sales did you make this week? \n"))#Amount of each salesales = 250#Determine commission of each sale25 / sales = commission#Multiply the commission times the amount of sales made to retrieve amount of total commission paytotal_sales_pay = sales_made * commission#Add total commission pay from sales with the total hours pay to get the weekly totaltotal_week_pay = total_sales_pay + total_hours_payprint(total_week_pay)
為一名推銷員開(kāi)發(fā) Python 項(xiàng)目。出現(xiàn)“無(wú)法分配給操作員”錯(cuò)誤
叮當(dāng)貓咪
2023-12-26 15:20:50