【python】第七次课作业

7-2

num = int(input("How many people did you invite?"))
if num <= 8:
	print("There are tables available.")
else:
	print("There are no tables available.")

7-4

while 1:
	food = input("Input name of the food you want to add to.('quit' for exit.)")
	if food == "quit":
		break
	else:
		print("We'll add it.")

7-8 7-9

print("Pastrami has been sold out.")
sandwich_orders = ['pastrami', 'dsd', 'yr', 'wqfrf', 
                   'xccv', 'pastrami', 'oigh', 'pastrami']
while 'pastrami' in sandwich_orders:
	sandwich_orders.remove('pastrami')
finished_sandwiches = []
while sandwich_orders:
    for sandwich in sandwich_orders:
	    print("I made your " + sandwich + " sandwich.")
	    finished_sandwiches.append(sandwich)
	    del sandwich_orders[0]
print("Now we have made these sandwiches:")
for sand in finished_sandwiches:
	print(sand)


猜你喜欢

转载自blog.csdn.net/karroyzgj/article/details/79738326
今日推荐