Commit d9d1f68c by BellCodeEditor

auto save

parent a459e771
import func
data=
\ No newline at end of file
import func
data = new_input()
pay = sum(总价)
print("所有选手的总得分"+str(pay))
\ No newline at end of file
xiaozhuo=open(r"C:\Users\Admin\Desktop\新建文本文档.txt","w",encoding="utf-8")
xiaozhuo.write("小兰十二本\n")
xiaozhuo.write("小强十二本\n")
xiaozhuo.write("李明十五本\n")
xiaozhuo.close()
with open(r"C:\Users\Admin\Desktop\新建文本文档.txt","r",encoding="utf-8")as xiaozhuo:
for i in xiaozhuo:
if"小强十二本"in i:
print("数据在里面")
#a=xiaozhuo.read()
#print(a)
#xiaozhuo.close()
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
total.append(unit)
print(total)
\ No newline at end of file
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print("请输入一个数字")
else:
total.append(unit)
print("*"*30)
return total
def sum(money):
count=0
for i in money:
count=count+i
return count
#总价=new_input()
#pay=sum(总价)
#print("你一共消费了"+str(pay)+"元!微信还是支付宝?")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment