Python80 python for python for 1.소스 print "\ntype 1" for counter in range( 3 ) : print "type 1 %d" % counter print "\ntype 2" for counter in range(0 , 3 ) : print "type 2 %d" % counter print "\ntype 3" for counter in range( 0, 3, 1) : print "type 3 %d" % counter print "\ntype 4" for counter in range( 3, 1, -1 ) : print "type 3 %d" % counter 결과 hacker@ubuntu:~/python$ python for1.py type 1 type 1 0 type 1 1 type 1 2.. 2016. 7. 21. python while 문 python while 문 1.소스 count = 1 while count 2016. 7. 21. if 문 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 2016. 7. 21. 사용자 입력 받기 raw_input 사용자 입력 받기 raw_input 1.소스 input = raw_input("input :\n") print "result = %s" % input 결과 hacker@ubuntu:~/python$ python input.py input : black falcon result = black falcon 2016. 7. 21. 이전 1 ··· 16 17 18 19 20 다음