Commit 30ad1d18 by BellCodeEditor

save project

parent dc70412a
Showing with 37 additions and 0 deletions
a=open(r'C:\Users\maku02\Desktop\杀币才会看的.txt','w',encoding='utf-8')
b=input('姓名:')
c=input('本数:')
a.write(b+':'+c+'本 ')
a.close()
\ No newline at end of file
def d():
a=[]
while True:
try:
b=int(input("价格:"))
except:
print("请输入一个整数!")
else:
if b==0:
break
else:
a.append(b)
return a
a=d()
print(a)
x=0
for i in range(len(a)):
z=a[i]
x=x+z
print(x)
total = []
def a():
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
total.append(unit)
print(total)
a()
\ 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