Skip to content

Instantly share code, notes, and snippets.

@nattybear
Created March 3, 2021 09:57
Show Gist options
  • Save nattybear/b5dc90a680371bf881f99da0b2c83e25 to your computer and use it in GitHub Desktop.
Save nattybear/b5dc90a680371bf881f99da0b2c83e25 to your computer and use it in GitHub Desktop.
파이썬 비교 연산 여러 개

먼저 제일 왼쪽의 비교 연산자를 평가합니다.

a != b

24와 같지 않으므로 결과는 True가 됩니다.

2 != 4  # True

이제 그 다음 비교 연산자인 <를 평가합니다.

True < c

True1보다 작지 않으므로 False가 됩니다.

True < 1  # False

이런 식으로 왼쪽부터 순서대로 평가를 진행하면 됩니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment