一.超市抹零
money_all =56.75+72.91+88.5+26.37+68.51
money_all_str=str(money_all)
print("商品总价格为:"+money_all_str)
money_real=int(money_all)
money_real_str=str(money_real)
print("实际金额为:"+money_real_str)
二.平均成绩
python=95
english=92
c=89
sub=python-c
avg=(python+c+english)/3
print("python与c的分差为:"+str(sub)+"分")
print("平均分:"+str(avg)+"分")
三.比较运算符
python=95
english=92
c=89
print("python="+str(python)+"english="+str(english)+"c="+str(c)+"\n")
print("python<english的结果:"+str(python<english))
print("python>english的结果:"+str(python>english))
print("python==english的结果:"+str(python==english))
print("python!=english的结果:"+str(python!=english))
print("python<=english的结果:"+str(python<=english))
print("python>=c的结果:"+str(python>=c))
四.手机打折
print("手机店在打折,活动进行中")
strweek=input("请输入中文日期:")
inttime=int(input("请输入小时:"))
if(strweek=="星期二"and (inttime>=10 and inttime<=11))or (strweek=="星期五"and(inttime>=14 and inttime<=15)):
print("恭喜你,获得抽奖资格")
else :
print("对不起,你来晚一步")
学号......3121