Commit 57d41817 by BellCodeEditor

save project

parent b57fa556
import func
a=func.pp()
b=func.rh(a)
print(b)
\ No newline at end of file
...@@ -4,12 +4,14 @@ def pp(): ...@@ -4,12 +4,14 @@ def pp():
unit= input("请输入:") unit= input("请输入:")
if unit== 'q': if unit== 'q':
break break
else:
try:
unit=int(unit)
except:
print("请输入数字!")
else: else:
total.append(unit) try:
print(total) unit=int(unit)
pp() except:
\ No newline at end of file print("请输入数字!")
else:
total.append(unit)
return total
def rh(b):
a=sum(b)
return a
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