PEP 20–The Zen of Python
PEP 20–The Zen of Python 파이썬의 철학과 디자인 원칙을 담고 있다. 파이썬 인터프리터에서 import this를 실행하면 볼 수 있다. 1. Beautiful is Better than Ugly. (아름다움이 추한 것보다 낫다) 코드는 보기 좋고 이해하기 쉽게 작성해야 한다. 1 2 3 4 5 6 7 8 # 아름다운 코드 names = ['Alice', 'Bob', 'Charlie'] for name in names: print(f"Hello, {name}!") # 추한 코드 x=['Alice','Bob','Charlie'] for i in range(len(x)):print("Hello, "+x[i]+"!") 2. Explicit is Better than Implicit. (명시적이 암시적인 것보다 낫다) 코드의 의도를 명확히 표현해야 한다. ...