목록SyntaxError (1)
메이플의 개발 스토리
[파이썬 오류] - match, SyntaxError: invalid syntax
파이썬 오류 파이썬 자습서를 통해 공부하는 중 match 문법을 사용한 코드에서 오류가 발생했습니다. 파이썬 자습서 : https://docs.python.org/ko/3/tutorial/controlflow.html#match-statements 코드 def http_error(status): match status: case 400: return "Bad request" case 404: return "Not found" case 418: return "I'm a teapot" case _: return "Something's wrong with the internet" 출력 결과 File "", line 2 match status: ^ SyntaxError: invalid syntax 확인해보니 제..
Python
2021. 12. 9. 10:10