#eraze_zero.py
money= eval(input("请输入商品的总金额:"))
money_str=str(money)
print('商品总金额为:' + money_str)
money2=int(money)
money2_str=str(money2)
print('实收金额为:' + money2_str)
print("学号后4位:3141")
#score_handle.py
course1=85
course2=96
course3=84
sub=course1-course3
avg=(course1+course2+course3)/3
print("课程1,3的分数之差:"+str(sub)+"分\n")
print("3门课的平均分:"+str(avg)+"分")
print("学号后4位:3141")
#comparison_operator.py
a=eval(input("请输入a:"))
b=eval(input("请输入b:"))
print('a>b的结果是:'+str(a>b))
print('a==b的结果是:'+str(a==b))
print('a<b的结果是:'+str(a<b))
print('a!=b的结果是:'+str(a!=b))
print('a>=b的结果是:'+str(a>=b))
print('a<=b的结果是:'+str(a<=b))
print("学号后4位:3141")
#sale.py
print("\n手机店正在打折,活动进行中......")
strWeek=input("请输入中文星期(如星期一):")
intTime=int(input("请输入时间中的小时(范围:0~23):"))
if(strWeek=="星期二"and(intTime>=10 and intTime<=11))or(strWeek=="星期五" and(intTime>=14 and intTime<=15)):
print("恭喜您,获得了折扣活动参与资格,快快选购吧!")
else:
print("对不起,您来晚一步,期待下次活动...")
print("学号后4位:3141")
#creat_new file.py
import os
directory = "D:\python"
filename = "example.txt"
filepath = os.path.join(directory, filename)
file = open(filepath, "w")
file.write("2.6.2")
file.close()
print(f"文件'{filename}'已创建成功")
print("学号后4位:3141")
标签:学号,money,读书笔记,3141,str,print,input,第二章 From: https://www.cnblogs.com/Housesnurse/p/17801225.html