CDA持证人阿涛哥

2020-08-12   阅读量: 6073

大数据 Python

# 绩效计算器 #

扫码加入数据分析学习群

问题:


# 绩效计算器 #

你作为酒水专柜负责人在同福客栈干了一段时间了,佟湘玉掌柜想对你管理的酒水专柜进行绩效考核,考核要求很简单:每天的净利润大于 3000 文钱为合格,否则不合格。

在"利润计算器"这一题中,你已经完成了计算净利润的 calc_profit() 函数,接下来请你写一个绩效计算器来计算一下酒水专柜每天绩效考核是否合格,要求:

1,再定义一个名为 calc_perf 的函数;

2,该函数有一个参数,为当天的净利润(calc_profit() 函数的返回值);

3,该函数功能为:当净利润大于 3000 时打印 合格,否则打印 不合格;

4,使用 input() 函数获取当天卖出的酒水数量;

5,调用函数并打印出酒水专柜当天绩效是否合格。

##回顾提示:

## "利润计算器"题的内容如下:

你在同福客栈工作,工作干得不错,佟湘玉老板让你做酒水专柜负责人,并许诺你卖出酒水可以获得净利润的1%作为提成奖励,

已知的信息如下:

酒水专柜目前只卖女儿红,每坛售价 100 文钱,成本为 40 文钱 ;

酒水专柜每天的各项成本为 300文钱。

接下来请你写一个利润计算器来计算一下酒水专柜每天的利润,要求:

1,定义一个名为 calc_profit 的函数;

2,该函数有一个参数,为当天卖出的酒水数量(坛);

3,函数的返回值为酒水专柜当天的净利润(不需要单位);

4,通过 input() 函数获取当天卖出的酒水数量;

5,调用函数并打印出酒水专柜当天的净利润和你的提成奖励.


作答:

def calc_profit(tan): #收入-支出=利润 ,tan 坛

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

return profit

def calc_perf(profit):

if profit > 3000:

print ("绩效合格")

else :

print ("绩效不合格")

tan = int(input("当天卖出的酒水坛数是:"))

profit = calc_profit(tan)

calc_perf (profit)


90.4965 5 6 关注作者 收藏

评论(2)

CDA持证人阿涛哥
2020-08-12

_LG1GYO1BVB6F2G9952KG08.png

0.0000 0 0 回复
CDA持证人阿涛哥
2020-08-12
def calc_profit(tan): #收入-支出=利润 ,tan 坛
  profit=int(tan)*100 - (int(tan)*40 +300)
  return profit
def calc_perf(profit):
    if profit > 3000:
        print ("绩效合格")
    else :
        print ("绩效不合格")
tan = int(input("当天卖出的酒水坛数是:"))
profit = calc_profit(tan)
calc_perf (profit)


0.0000 0 0 回复

推荐课程

推荐帖子