bus=input("What are you wan to bus:")
print(f"Let me see if I can find you a {bus}")

people=input("How many you are want to invite people:")
people=int(people)
if people>8:
print("没有空座")
else:
print("有空座")

digit=input("输入一个数字:")
digit=int(digit)
if digit%10==0:
print(f"{digit} 是10的整数倍")
else:
print(f"{digit} 不是10的整数倍")

pisa=" "
while pisa!='quit':
pisa=input("输入一种披萨配料:")
if pisa!='quit':
print(f"我们会在披萨中添加 {pisa} 配料")

请编写一个循环, 在其中询问用户的年龄, 并指出其票价。
age=" "
while age!=-1:
age=input("输入观众年龄:")
age=int(age)
if age>12:
print("15$")
elif age>3:
print("10$")
elif age<=3 and age>0:
print("0$")
else:
break

在while 循环中使用条件测试来结束循环。
使用变量active 来控制循环结束的时机。 使用break 语句在用户输入’quit’
时退出循环。
active=True
while active!=False:
age=input("输入观众年龄:")
age=int(age)
if age>12:
print("15$")
elif age>3:
print("10$")
elif age<=3 and age>0:
print("0$")
else:
active=False

略
遍历列表sandwich_orders , 对于其中的每种三明治, 都打印一条消息, 如I made your tuna sandwich,并将其移到列表finished_sandwiches 。
所有三明治都制作好后, 打印一条消息, 将这些三明治列出来。
sandwich_orders=['a','b','c']
finished_sandwiches=[]
while sandwich_orders:
sandwich=sandwich_orders.pop()
print(f"I made your {sandwich} sandwich")
finished_sandwiches.append(sandwich)
for a in finished_sandwiches:
print(a)

sandwich_orders=['pastrami','a','pastrami','b','c','pastrami']
finished_sandwiches=[]
print('pastrami'+"卖完了")
while 'pastrami'in sandwich_orders:
sandwich_orders.remove('pastrami')
while sandwich_orders:
sandwich=sandwich_orders.pop()
print(f"I made your {sandwich} sandwich")
finished_sandwiches.append(sandwich)
for a in finished_sandwiches:
print(a)

使用类似于“If you could visit one place in the world, where would you go?”的提示, 并编写一个打印调查结果的代码块.
travel={}
ends='yes'
while ends!='no':
location=input("请输入想去的地方:")
people=input("带哪个朋友:")
travel[location]=people
ends=input("是否继续\'yes or no\'")
for m,n in travel.items():
print(f"输入想去的地方:{m} 带哪个朋友:{n}")
