unconfirmed_users = ['alice','brian','candace']
confirmed_users = []

while unconfirmed_users:
	current_user = unconfirmed_users.pop()
	print("Verifying user: " + current_user.title())
	confirmed_users.append(current_user)

print("\nThe following users have been confirmed:")
for confirmed_user in confirmed_users:
	print(confirmed_user.title())


pets = ['dog','cat','golden fish','cat','rabbit','cat']
print(pets)

#删除列表中所有的元素，如果只有一个可以用if
while 'cat' in pets:
	pets.remove('cat')

print(pets)

#使用用户输入来填充字典
responses = {}

polling_active = True

while polling_active:
	name = input("\nWhat's your name?")
	response = input("Which moutain would you like to climb someday?")

	responses[name] = response

	repeat = input("Would you like to let another person respond? (yes/no)")
	if repeat == 'no':
		polling_active = False

print("\n--- Poll Result ---")
for name, response in responses.items():
	print(name + " would like to climb " + response + ".")



fruit_orders = ['apple','banana','apple','pear','watermelon','apple']
finish_orders = []

print("Apple is sold out!")

while 'apple' in fruit_orders:
	fruit_orders.remove('apple')

while fruit_orders:
	fruit = fruit_orders.pop()
	print("I made your " + fruit + "!")
	finish_orders.append(fruit) #往list里添加元素

for new_fruit in finish_orders:
	print(new_fruit)


dream_place = {}

active = True

while active:
	name = input("\nWhat's your name?")
	place = input("\nAnd where is your dream destination?")
	dream_place[name] = place

	willContinue = input("Anyone else would like to participate? (yes/no)")
	if willContinue == 'no':
		active = False

for name, place in dream_place.items():
	print(name + " would like to go to " + place + ".")
