Commit a208f2eb by BellCodeEditor

save project

parent 8bb04fb8
Showing with 37 additions and 3 deletions
def somethings():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
b=int(unit)
except:
print('请重新输入整数')
total.append(unit)
print(total)
\ No newline at end of file
......@@ -12,7 +12,13 @@ def funk():
else:
abcd.append(abcde)
return abcd
def sun(name):
count=0
for i in name:
count=count+i
return count
f=funk()
print(f)
Morlani=sun(f)
print(Morlani)
def funk():
abcd=[]
while True:
abcde=input('不知道')
if abcde=='q':
break
else:
try:
b=int(abcde)
except:
print('byd我cnmd请输入负数')
else:
abcd.append(b)
return abcd
def sun(n):
count=0
for i in n:
count=count+i
return count
f=funk()
ani=sun(f)
print(ani)
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