Commit d684accd by BellCodeEditor

auto save

parent 48e3665d
try:
age = int(input('你今年几岁了'))
except:
print('要输入整数')
else:
if age < 18:
print ('不能喝酒')
print('程序结束')
\ No newline at end of file
......@@ -5,6 +5,22 @@ def o_o():
if unit== 'q':
break
else:
total.append(unit)
print(total)
o_o()
try:
unit=int(unit)
except:
print("输入错误")
else:
total.append(unit)
return total
def sum(money):
count=0
for i in money:
count=count+i
return count
#s=o_o()
#print(s)
#c=sum(s)
#print(c)
import func
data =func.o_o()
reslut=func.sum(data)
print(reslut)
\ 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