Python-basic
Jump to navigation
Jump to search
Overview
Python 프로그래밍 내용 정리
Statement
for
- 구구단 예제
<source lang=python> >>> for i in range(2,10): ... for j in range(1, 10): ... print(i*j, end=" ") ... print() </source>
while
while 문은 지정된 조건이 참일 경우에만 문장을 수행한다.
while <조건문>:
<수행할 문장1>
<수행할 문장2>
Sample <source lang=python> num = 0 while num < 10:
num = num +1
print("Check value. num[%d]" % num)
if num == 10:
print("Last number")
</source>
References
<references />