99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2020-08-12 閱讀量: 1999
# 利潤計算器 #


問題:

# 利潤計算器 #

你在同??蜅9ぷ?工作干得不錯,佟湘玉老板讓你做酒水專柜負責人,并許諾你賣出酒水可以獲得凈利潤的1%作為提成獎勵,

已知的信息如下:


酒水專柜目前只賣女兒紅,每壇售價 100 文錢,成本為 40 文錢 ;

酒水專柜每天的各項成本為 300文錢。

接下來請你寫一個利潤計算器來計算一下酒水專柜每天的利潤,要求:

1,定義一個名為 calc_profit 的函數(shù);

2,該函數(shù)有一個參數(shù),為當天賣出的酒水數(shù)量(壇);

3,函數(shù)的返回值為酒水專柜當天的凈利潤(不需要單位);

4,通過 input() 函數(shù)獲取當天賣出的酒水數(shù)量;

5,調(diào)用函數(shù)并打印出酒水專柜當天的凈利潤和你的提成獎勵.


作答:

def calc_profit(tan): #收入-支出=利潤 ,tan 壇

profit=int(tan)*100 - (int(tan)*40 +300)

return profit

tan = int(input("當天賣出的女兒紅壇數(shù)是:"))

print("當天凈利潤為"+str(calc_profit(tan))+"文錢,"+"當天的提成獎勵是"+str(calc_profit(tan)*0.01)+"文錢")



58.4847
2
關(guān)注作者
收藏
評論(1)

發(fā)表評論
CDA持證人阿濤哥
2020-08-12
def calc_profit(tan): #收入-支出=利潤 ,tan 壇
  profit=int(tan)*100 - (int(tan)*40 +300)
  return profit
tan = int(input("當天賣出的女兒紅壇數(shù)是:"))
print("當天凈利潤為"+str(calc_profit(tan))+"文錢,"+"當天的提成獎勵是"+str(calc_profit(tan)*0.01)+"文錢")


0.0000 0 0 回復