Commit e2f441e8 by BellCodeEditor

save project

parent c01d08f6
Showing with 25 additions and 9 deletions
def new_aa():
jiage=[]
def a():
c=[]
while True:
wenti=input("请输入价.(按q退出)")
if wenti == "q":
z=input('请输入价格(按q退出)')
if z=="q":
break
else:
try:
a=int(wenti)
v=int(z)
except:
print("请重新输入")
print("请重新输入一个数字")
else:
jiage.append(a)
c.append(v)
finally:
print("_"*30)
print(jiage)
new_aa()
return c
def g(h):
p=0
for i in h:
p=p+i
return p
u=a()
m=g(u)
#print("你一共消费了"+str(m)+"元")
......
file1=open(r'C:\Users\Administrator\Desktop\teak.txt','a',encoding='utf-8')
#file1.write("小张:12本\n")
#file1.write("小需:12本\n")
#file1.write("小鱼:15本\n")
file1.write("小兰:10本\n")
file1.close()
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