Commit 5fc4e86a by BellCodeEditor

auto save

parent e728c6a5
...@@ -20,8 +20,8 @@ def sum(ji): ...@@ -20,8 +20,8 @@ def sum(ji):
count=count+i count=count+i
return count return count
# result=new_input() result=new_input()
# print(result[0]) print(result[0])
price=new_input() price=new_input()
pay=sum(price) pay=sum(price)
print("你一共消费了"+str(pay)+"现金还是扫码") print("你一共消费了"+str(pay)+"现金还是扫码")
......
def sum(money): import func
count=0
for i in money data=func.new_input()
count=count+1 score=func.sum(data)
return count print("这位选手的分数为"+str(score))
\ No newline at end of file
import func
x=func.new_input()
\ No newline at end of file
total = [] def new_input():
while True: total = []
unit= input("请输入:") while True:
if unit== 'q': unit= input("请输入:")
break if unit== 'q':
else: break
total.append(unit) else:
print(total) try:
\ No newline at end of file unit=int(unit)
except:
print("请输入一个数字")
else:
total.append(unit)
finally:
print("_"*30)
return total
def sum(ji):
count=0
for i in ji:
count=count+i
return count
result=new_input()
# print(result[0])
price=new_input()
pay=sum(price)
# print("你一共消费了"+str(pay)+"现金还是扫码")
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