ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 문법 - Boolean
    Python 2018. 11. 14. 17:45

    Boolean

    Boolean은 '참'과 '거짓'을 나타낼 때 쓰인다.


    수를 비교할 때에는 비교연산자를 사용한다.


    문법 - 

    1
    2
    3
    print(1==1)
    print(1<2)
    print(2<1)
    cs




    특정 문자열 안에 찾고자하는 문자열이 있는 경우 'in', 'not in' 연산자를 사용한다.


    문법 - 

    1
    2
    3
    4
    5
    #Membership operator
    print('world' in 'Hello world')
    print("world" in "Hello World"#대소문자를 구분해야한다.
    print('bye' not in 'Hello world')
    print('bye' not in 'bye world')
    cs





    'Python' 카테고리의 다른 글

    문법 - 반복문  (0) 2018.11.15
    문법 - Dictionary  (0) 2018.11.14
    문법 - list  (0) 2018.11.14
    문법 - 조건문  (0) 2018.11.14
    설치 및 연동 - Windows  (0) 2018.11.13
Designed by Tistory.