Python基础(2)分段计算利润

lirun=int(raw_input('input'))
if lirun <=10:
    jiangjin=lirun * 0.1
    print 'your jinagjin is',jiangjin
elif (lirun> 10 )and (lirun <=20):
    jiangjin=10*0.1+(lirun-10)*0.075
    print jiangjin
elif (lirun>20) and (lirun <=40):
    jiangjin=0.05*(lirun-20)
    print jiangjin

posted @ 2017-06-25 14:59  人间好时节  阅读(826)  评论(0编辑  收藏  举报