우리나라 말로 '주석'을 의미하며 코드와 달리 개발자를 위해 작성된 글을 말한다.
파이썬에서는 문장 앞에 # 를 달거나 작은따옴표'''로 감싸서 사용한다.
def 함수명(parameter):
문장1
문장2
...
문장N
[return 리턴값]
여기서 parameter 와 return 값은 option
All required parameters must be placed before any default arguments. Simply because they are mandatory, whereas default arguments are not. Syntactically, it would be impossible for the interpreter to decide which values match which arguments if mixed modes were allowed. A SyntaxError is raised if the arguments are not given in the correct order:
만약 mixed mode 가 허락된다면, 해석자에게 어떤 values 를 각각 어떤 arguments 와 match 해야 할지 결정하는 것이 불가능하게 된다고 한다.
내 생각에도 변수의 위치와 순서에 영향을 받는 non-defualt value와 순서에 영향을 받지 않는 default value 를 섞어서 사용하는 경우, 인자와 value 를 서로 적용하는데 명확한 한가지의 result가 아닌 다른 option 들이 생길 수 있기 때문에 이를 명확하게 하기 위해 이런 규칙을 정해둔 것 같다는 생각이 든다.
예를 들어,
def fun1(a="who is you", b="True", x, y):
... print a,b,x,y
이렇게 지정하는 것이 가능하다고 가정하면,
func1("ok a", "ok b", 1) # Is 1 assigned to x or ?
func1(1) # Is 1 assigned to a or ?
func1(1, 2) # ?
이와 같이 혼돈이 생기게 된다.
참고
https://stackoverflow.com/questions/16932825/why-cant-non-default-arguments-follow-default-arguments