Commit f3e26ab0 by BellCodeEditor

auto save

parent 05e7d622
{
"python.testing.pytestArgs": [
"."
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true
}
\ No newline at end of file
import func
print(func.sum(func.x()))
def x ():
total = []
while True:
unit= input("请输入:")
try:
unit= int (unit)
except:
if unit== 'q':
break
print("请输入整数")
else:
total.append(unit)
return total
def sum(y):
count = 0
for i in y:
count=count+i
return count
#print(sum(x()))
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