본문 바로가기
Python

if 문

by SpeeDr00t 2016. 7. 21.
반응형

if 문

1.소스

grade = 80

if grade >= 60 :
    print "pass"
else :
    print "failed"


if grade >= 90 :
    print "A"
elif grade >= 80 :
    print "B"
else :
    print "failed"

결과

hacker@ubuntu:~/python$ python if1.py 
pass
B
반응형

'Python' 카테고리의 다른 글

python for  (0) 2016.07.21
python while 문  (0) 2016.07.21
사용자 입력 받기 raw_input  (0) 2016.07.21
python hello world 찍기  (0) 2016.07.21
windows10 및 ubuntu 에서 setuptools 및 pip 설치  (0) 2016.07.14