Skip to content

Commit 8acdcab

Browse files
authored
Create 1.py
1 parent dd5d165 commit 8acdcab

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

5/1.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
stack = []
2+
3+
# 삽입(5) - 삽입(2) - 삽입(3) - 삽입(7) - 삭제() - 삽입(1) - 삽입(4) - 삭제()
4+
stack.append(5)
5+
stack.append(2)
6+
stack.append(3)
7+
stack.append(7)
8+
stack.pop()
9+
stack.append(1)
10+
stack.append(4)
11+
stack.pop()
12+
13+
print(stack[::-1]) # 최상단 원소부터 출력

0 commit comments

Comments
 (0)