Commit cd744fb3 by BellCodeEditor

save project

parent 1fd8fc4b
import func
data=func.new_input()
print(data)
def new_input():
total = []
while True:
try:
unit= int(input("请输入:"))
except:
#if unit== 'q':
if unit== 'q':
break
else:
try:
unit= int(unit)
except:
unit= input("请输入错误")
else:
total.append(unit)
print(total)
new_input()
return total
def sum(a):
sum=0
for i in range(len(a)):
sum+=a[i]
return sum
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