亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為一名推銷員開發 Python 項目。出現“無法分配給操作員”錯誤

為一名推銷員開發 Python 項目。出現“無法分配給操作員”錯誤

叮當貓咪 2023-12-26 15:20:50
我正在為一名推銷員開發一個 Python 項目。該項目根據每周的工作時間和每周銷售傭金的百分比計算工資,并將它們加在一起得到銷售員的每周總工資。我遇到的問題是將銷售額除以他們從每次銷售中獲得的百分比。錯誤是“無法分配給操作員”#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)
查看完整描述

2 回答

?
largeQ

TA貢獻2039條經驗 獲得超8個贊

你寫了:

25 / sales = commission

但是當給變量賦值時,需要將變量放在語句的開頭。

嘗試

commission = 25 / sales


查看完整回答
反對 回復 2023-12-26
?
阿波羅的戰車

TA貢獻1862條經驗 獲得超6個贊

25 / sales = commission這一行拋出錯誤。我想應該是的comission = 25 / sales。你嘗試將 的值賦值comission給其結果25 / sales不起作用。



查看完整回答
反對 回復 2023-12-26
  • 2 回答
  • 0 關注
  • 185 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號