목록Languages/Python (1)
공부하는 스누피
[Python] 함수 인자로 리스트 넘기기
https://nikos7am.com/posts/mutable-default-arguments/ Avoid using an empty list as a default argument to a function A very common error in Python is the use of an empty list as a default argument to a function. This is not the right way to do it and can cause unwanted behavior. See for example below: def append_to_list(element, list_to_append=[]): list_to_append.append( nikos7am.com 함수 인자로 리스트를 ..
Languages/Python
2020. 8. 30. 11:44