Commit 6e46a57c by BellCodeEditor

save project

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