Commit 78fe88f9 by BellCodeEditor

auto save

parent 578e41ee
import turtle
total = [] total = []
while True: def new_input():
unit= input("请输入:") while True:
if unit== 'q': unit=input("请输入:")
break if unit== 'q':
else: break
total.append(unit) try:
print(total) unit=int(unit)
\ No newline at end of file except:
print("请输入一个数字")
else:
total.append(unit)
finally:
print("-"*30)
return total
def get_sumscore(score):
sumscore=0
for i in score:
sumscore+=i
print(sumscore)
import func
data=func.new_input()
func.get_sumscore(data)
\ No newline at end of file
file1=open(r'C:\Users\fhxls\Desktop\hhh.txt','w',encoding='utf-8')
file1.write("啦啦啦啦")
file1.write("嘎嘎嘎嘎")
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