Commit 6e46a57c by BellCodeEditor

save project

parent d9e5f296
Showing with 67 additions and 23 deletions
try:
age = int(input("你今年几岁"))
except:
print("输入整数")
else:
if age > 18:
print('不可以喝酒')
print("结束")
\ No newline at end of file
total=[]
def sum():
con=0
while True:
unit=input("输入:")
if unit==" ":
break
try:
int(unit)
except:
print("输入合法字符")
else:
total.append(unit)
for i in sum:
con=con+i
return con
result=sum()
print(result)
\ No newline at end of file
unit=input("输入:")
if unit==" ":
break
else:
try:
int(unit)
except:
print("输入合法字符")
else:
total.append(unit)
\ No newline at end of file
def hello(name):
content="你好"+name
return content
result=hello("小于")
print(result)
\ No newline at end of file
con=0
total = []
def new():
while True:
unit=input("输入:")
if unit==" ":
break
else:
try:
int(unit)
except:
print("输入合法字符")
else:
total.append(unit)
def sum():
for i in total:
con = con+i
return con
sum()
print(con)
\ No newline at end of file
def d():
total = []
while True:
unit= input("请输入:")
if unit=='q':
break
try:
int(input("菜名"))
except:
print("输入菜名")
else:
print("total")
d()
def num(price):
content=content+price
return content
result=num()
print(result)
num()
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