Commit 047ef2b7 by BellCodeEditor

auto save

parent 8af8fdfa
file1=open(r'C:\Users\Administrator\Desktop\text.txt','w',encoding='utf-8')
file1.write('小兰:12本')
file1.close()
\ No newline at end of file
import func
hk=func.sb()
sc=func.sum(hk)
print(str(sc)+'分')
\ No newline at end of file
......@@ -8,7 +8,7 @@ def sb():
try:
unit=int(unit)
except:
print('输入错误'+'请重新输入')
print('输入错误'+' 请重新输入')
else:
total.append(unit)
finally:
......@@ -17,7 +17,8 @@ def sb():
def sum(money):
count=0
for i in money:
count+=i
count=count+i
return count
sb()
sum(total)
\ No newline at end of file
# price=sb()
# pay=sum(price)
# print('sb '+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