Commit 39f29a38 by BellCodeEditor

save project

parent 3490661a
Showing with 18 additions and 7 deletions
def n(): def n():
...@@ -5,12 +5,23 @@ def n(): ...@@ -5,12 +5,23 @@ def n():
if unit== 'q': if unit== 'q':
break break
else: else:
try:
unit = int(unit)
except:
print('请重输')
else:
total.append(unit) total.append(unit)
print(total)
n()
try: return total
except[]:
else: def a(qian):
\ No newline at end of file sum = 0
for i in qian:
sum = sum +i
return sum
pp=n()
b=a(pp)
print(b)
\ 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