NP30 用列表实现队列
This commit is contained in:
parent
603ffc167f
commit
afe610bfe2
18
NP/NP30.py
Normal file
18
NP/NP30.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP30.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
num = int(input())
|
||||||
|
queue = [1, 2, 3, 4, 5]
|
||||||
|
queue.pop(0)
|
||||||
|
print(queue)
|
||||||
|
queue.pop(0)
|
||||||
|
print(queue)
|
||||||
|
queue.append(num)
|
||||||
|
print(queue)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
Loading…
Reference in New Issue
Block a user