파일 목록
# week09_01_chap06_04
def is_stack_full():
global SIZE, stack, top
if top == SIZE-1:
return True
else:
return False
def push(data):
global SIZE, stack, top
if is_stack_full():
print("스택이 꽉 찼습니다.")
return
top += 1
stack[top] = data
SIZE = 5
stack = ["커피", "녹차", "꿀물", "콜라", None]
top = 3
print(stack)
push("환타")
print(stack)
push("게토레이")