Commit 0bd8f72b by BellCodeEditor

save project

parent 8c7e73ab
Showing with 9 additions and 4 deletions
...@@ -5,16 +5,21 @@ def new_input(): ...@@ -5,16 +5,21 @@ def new_input():
if unit== 'q': if unit== 'q':
break break
else: else:
#total.append(unit)
try: try:
unit=int(unit) unit=int(unit)
except: except:
print("请输入一个整数") print("请输入一个整数")
else: else:
total.append(unit) total.append(unit)
#print(total)
return total return total
lag=new_input() def abc(last1):
print(lag) count = 0
for i in last1:
count += i
return count
result = new_input()
pay=abc(result)
print("一共"p"元")
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