sandwich_orders = ['niurou','zhurou','pas','rabbit','pas','apple','banana','pas']
print("--- pas is not in ---")
'''while 'pas' in sandwich_orders:
sandwich_orders.remove('pas')'''
sandwich_orders = set(sandwich_orders)
sandwich_orders.remove('pas')
finishied_sandwich = []
while sandwich_orders :
finish = sandwich_orders.pop(0)
print(f"I have finished {finish}")
finishied_sandwich.append(finish)
print(sandwich_orders)
print(finishied_sandwich)

学习练习遇到的问题,求解答