print("7-1")
message = input("let me see if I can find you a: ")
print(message)
#7-2
print("7-2")
message = input("how many persons have lunch:")
message = int(message)
if message > 8:
print("sorry,no table.")
else:
print("Yes, we have table.")
print("7-3")
message = input("please input a number: ")
message =int(message)
if message % 10 == 0:
print('the right number')
else:
print('no the number')
print('7-4')
prompt = '\n please input some pizza meterial:'
prompt += "\nEnter 'quit' to end the program."
message = " "
while message != 'quit':
message = input(prompt)
#print("we will put " + message + " in the pizza")
if message !='quit':
print(message)
#7-5
print('7-5')
active =True
while active:
edg = int(input("please input edg"))
if edg < 3:
print('free')
elif edg >= 3 and edg <=12:
print('$10')
else:
print('$15')
print('7-6-1')
active =True
while active:
edg = input("please input edg")
if edg == 'quit':
break
if int(edg) < 3:
print('free')
elif int(edg) >= 3 and int(edg) <=12:
print('$10')
else:
print('$15')
print('7-7')
x = 1
while x <= 5:
print(x)
print('7-8')
sandwich_orders = ["beef","poke","tomato"]
# 创建空列表
finish_sandwiches = []
#循环,直到列表的元素空了
while sandwich_orders:
# 函数pop每次以一个的方式从末尾删除元素
sandwich_order = sandwich_orders.pop()
# 显示删除的元素
print("I made your " + sandwich_order)
#将删除的元素移动到新的列表
finish_sandwiches.append(sandwich_order)
#输出新列表
print("\nfinish_sandwiche:")
for finish_sandwiche in finish_sandwiches:
print(finish_sandwiche)
print("7-9")
sandwich_orders = ["beef","poke","tomato","pastrami","pastrami","pastrami"]
print(sandwich_orders)
print("pastrami have been solded out!")
#循环
while 'pastrami' in sandwich_orders:
sandwich_orders.remove('pastrami')
print(sandwich_orders)
print('7-10梦想的度假胜地')
#创建一个空字典
responses = {}
#设置一个标志,指出调查是否继续
polling_active = True
while polling_active:
name = input("\nWhat is your name?")
response = input("if you could visit one place in the world, where would you go ?")
#将答案存在字典中,name 是key,response是value,responses{name:response}
responses[name] = response
#看看是否还有人要参加调查
repeat = input("would you like to let another person respond?(yes / no)")
if repeat == 'no':
polling_active = False
#调查结果,显示结果
print("\n --- Poll Results ---")
for name,responses in responses.items():
print(name + " want to go " +responses +'.' )