Commit 2b44158b by BellCodeEditor

save project

parent 15bbe2c7
...@@ -19,8 +19,8 @@ def sum_a(list_a): ...@@ -19,8 +19,8 @@ def sum_a(list_a):
for i in list_a: for i in list_a:
sumnum+=i sumnum+=i
return sumnum return sumnum
a=new_input() #a=new_input()
b=sum_a(a) #b=sum_a(a)
print(sumnum) #print(sumnum)
def new_input(): import feh
total = [] a=feh.new_input()
while True: b=feh.sum_a(a)
unit= input("请输入:") print(b)
if unit== 'q':
break
else:
try:
price=int(unit)
except:
print("输入整数哦")
else:
total.append(price)
print(total)
return total
a=new_input()
sumnum=0
for i in a:
sumnum+=i
print(sumnum)
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
price=int(unit)
except:
print("输入整数哦")
else:
total.append(price)
print(total)
return total
a=new_input()
sumnum=0
for i in a:
sumnum+=i
print(sumnum)
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