Menu



Manage

Cord > Study_Algorithm 전체 다운로드
Study_Algorithm > 9/week09_04_chap06_06_self.py Lines 22 | 373 바이트
다운로드

                        # week09_04_chap06_06_self.py

def pop() -> str:
    global SIZE, stack, top
    if top == -1:
        print("스택이 비었습니다.")
        return None
    data = stack[top]
    stack[top] = None
    top = top - 1
    return data


SIZE = 5
stack = ["커피", None, None, None, None]
top = 0

print(stack)
print(pop())
print(stack)
print(pop())