Commit 0b51896d by BellCodeEditor

auto save

parent 9577cffd
Showing with 13 additions and 6 deletions
...@@ -10,14 +10,21 @@ def new_input(): ...@@ -10,14 +10,21 @@ def new_input():
print("请输入整数") print("请输入整数")
else: else:
total.append(unit) total.append(unit)
finally:
print("_"*30) print("_"*30)
print(total) return total
# if unit== 'q':
# break
# else:
new_input() result=new_input()
print(result)
def sum(new_result):
count=0
for i in result:
count=count+i
return count
new_count=sum(result)
print("总价格是:"+str(new_count))
# try: # try:
# unit= int(input("请输入:")) # unit= int(input("请输入:"))
......
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