파이썬의 조건연산자

>   greater than
<   smaller than
==  equals
!=  is not


조건은 항상 변수와 결합 if 구문

x = int(input("Tell X"))

if x == 4:
    print 'You guessed correctly!'

print 'End of program.'


if else 구문

x = int(input("Tell X"))

if x == 4:
    print 'You guessed correctly!'
else:
    print 'Wrong guess'

print 'End of program.'


'프로그래밍 > Python' 카테고리의 다른 글

Python Tutorial : While loop [5]  (0) 2016.04.15
Python Tutorial : For loops [4]  (0) 2016.04.15
Python Tutorial : Variables [3]  (0) 2016.04.15
Python Tutorial : Text input and output [1]  (0) 2016.04.15
파이썬 기초 - Python이란?  (0) 2016.04.14

+ Recent posts