# 定义队列 queue = [1, 2, 3, 4, 5] # 取出队首元素 first_element = queue.pop(0) print(queue) # 取出队首元素 second_element = queue.pop(0) print(queue) # 添加元素到队列 element = int(input()) queue.append(element) print(queue)
# 定义队列 queue = [1, 2, 3, 4, 5] # 取出队首元素 first_element = queue.pop(0) print(queue) # 取出队首元素 second_element = queue.pop(0) print(queue) # 添加元素到队列 element = int(input()) queue.append(element) print(queue)