break 반복문을 탈출

continue 명령을 뛰어넘고 반복문 재실행 


for i in [5, 4, 3, 2, 1] :

print(i)

print('Blastoff')


none자료형은 상수이다. 공백을 쓰기 위해서 사용한다. 


smallest = None

print('Before')

for value in [9, 41, 12, 3, 74, 15] :

if smallest is None :

smallest = value:

elif value < smallest :

smallest = value

print(smallest, value)

print('After', smallest)


is ==

is not != 


is & is not이 더 강함 

ex) 0 is 0.0 (false) /  0 == 0.0 (true)

자료형과 값 모두 동등하길 요구하기 때문에 

숫자나 문자열을 사용한다면 is를 사용하지 마시오. 

헷갈릴 수 있음 . 


is 는 bool 자료형 이나 None 자료형에만 사용한다. 






'programming > python' 카테고리의 다른 글

튜플  (0) 2019.06.04
딕셔너리  (0) 2019.06.03
Posted by 도이(doi)
,