Commit 80d116de by BellCodeEditor

auto save

parent dc70412a
Showing with 27 additions and 0 deletions
#file=open(r"C:\Users\Administrator\Desktop\test.txt","a",encoding="utf-8")
#file.write("小强:15本")
#file.close()
#with open(r"C:\Users\Administrator\Desktop\test.txt","a",encoding="utf-8") as file:
# file.write("小红:10本")
with open(r"C:\Users\Administrator\Desktop\test.txt","r",encoding="utf-8") as file:
a=file.read()
print(a)
\ No newline at end of file
def jijia():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
total.append(int(unit))
return total
def he(money):
sum=0
for i in money:
sum=sum+i
return sum
price=jijia()
a=he(price)
print(a)
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