-
x: int = 4 match x: case int() as e: print(f"It's int, {e}") case x if x > 1: print("It's greater than 1") case 4: print("It's four")
결과: It's int, 4
참고:
'python > 기본' 카테고리의 다른 글
Python Enum (0) 2022.10.21 Python Closure (0) 2022.10.21 requirements.txt 자동 생성하기 (0) 2022.05.31 datetime / time (0) 2022.05.02 tempfile / subprocess (0) 2022.05.02