def say(a):
return 'hi'
a=4
b=say(a)
print(b)

이렇게 하면 hi 가 출력되는데


def say(a):
return 'hi'
a=b
b=say(a)
print(b)

이렇게하면


왜 오류만 나오는걸까요?

a매개변수에 b와 같은 문자는 안되고 숫자만 넣어야하는 문법 법칙이 있는건가요?


오류 메세지는 아래와 같이 나왔습니다

C:\anaconda3\python.exe C:/Users/.PyCharmCE2018.3/config/scratches/scratch.py

Traceback (most recent call last):

  File "C:/Users/.PyCharmCE2018.3/config/scratches/scratch.py", line 3, in

    a=b

NameError: name 'b' is not defined


Process finished with exit code 1