Commit 6f8e8098 by BellCodeEditor

save project

parent 05e7d622
def suan_zhang():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
print("-"*30)
except:
print("要输入整数哟")
else:
total.append(unit)
return total
def sum(m):
count=0
for i in m:
count=count+i
return count
a=suan_zhang()
b=sum(a)
# print("您一共消费"+str(b)+"元。")
\ No newline at end of file
import func
data=func.suan_zhang()
ggg=func.sum()
data
ggg
print("您一共得分"+str(b)+"分.")
\ No newline at end of file
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