Commit cd744fb3 by BellCodeEditor

save project

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