본문 바로가기

Python/Python 어렵게 배우기

Python 어렵게 배우기 - Exercise 28: Boolean Practice

원문 : http://learnpythonthehardway.org/book/ex28.html



아래 항목들을 보면서 참인지 거짓인지 맞춰보세요

True and True

False and True

1 == 1 and 2 == 1

"test" == "test"

1 == 1 or 2 != 1

True and 1 == 1

False and 0 != 0

True or 1 == 1

"test" == "testing"

1 != 0 and 2 == 1

"test" != "testing"

"test" == 1

not (True and False)

not (1 == 1 and 0 != 1)

not (10 == 1 or 1000 == 1000)

not (1 != 10 or 3 == 4)

not ("testing" == "testing" and "Zed" == "Cool Guy")

1 == 1 and not ("testing" == 1 or 1 == 0)

"chunky" == "bacon" and not (3 == 4 or 3 == 3)

3 == 3 and not ("testing" == "testing" or "Python" == "Fun")




결과는 python shell 을 열고 직접 확인해 보세요



반응형