x = "Hi!" #전역변수
def func():
    print(x)

func() #함수 안에서 사용해도 OK
print(x) #함수 밖에서 사용해도 OK

def func2():
    y = "Bye!" #지역 변수
    print(y)

func2() #함수 안에서 사용하면 OK
#print(y) #함수 밖에 사용하면 오류 발생

#문자열 '밥 먹었니?'를 담아보세요.
greeting = _______________

#서울 인사말을 출력하면 다음과 같습니다
print('서울: ', greeting)

#함수 busan()안에 '밥 뭇나?'가 담긴 변수 greeting을 넣어보세요.
def busan():
    ______________________
    print('부산:', greeting)

#함수 busan을 실행하기
busan()
#변수 greeting 출력하기
print(greeting)


Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: