Commit 39f29a38 by BellCodeEditor

save project

parent 3490661a
Showing with 19 additions and 8 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:
total.append(unit) try:
print(total) unit = int(unit)
n() except:
print('请重输')
else:
total.append(unit)
return total
try:
except[]:
else:
\ No newline at end of file def a(qian):
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