Commit d69982c1 by BellCodeEditor

save project

parent 6b63d234
Showing with 13 additions and 3 deletions
player=input("请出拳:石头/剪刀/布")# 玩家出拳 with open(r'C:\Users\Administrator\Desktop.txt','r',encoding='utf-8')as file:
print("玩家出拳:"+player) a=file.readlines()
\ No newline at end of file final_sum=[]
for i in a:
data=i.split()
sum=0
for sale in data[1:]:
sum+=int(sale)
result=data[0]+str(sum)+'\n'
final_sum.append(result)
with open(r'C:\Users\Administrator\Desktop.txt','a',encoding='utf-8')as file2:
file2.writelines(final_sum)
\ 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