Commit 5105554c by BellCodeEditor

auto save

parent 7eaed43a
Showing with 18 additions and 0 deletions
def new_input():
yan=0
while True:
unit=input("请输入数字")
if unit== "p":
break
else:
try:
unit1=int(unit)
except:
print("格式结束,输入整数")
else:
yan=yan+unit1
print(yan)
return yan
c=new_input()
print(c)
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