" async="async"> ', { cookie_domain: 'auto', cookie_flags: 'max-age=0;domain=.tistory.com', cookie_expires: 7 * 24 * 60 * 60 // 7 days, in seconds }); Python은 null을 어떻게 표현할까?

게임 프로그래밍/Python

Python은 null을 어떻게 표현할까?

Alexu 2019. 10. 11. 19:27
반응형
if (NullValue != null){
	printf("안비었어!");
}

C에서는 Null로 값이 유효한지를 확인한다.

파이썬에서도 null을 사용할 수 있을까?

 

파이썬에서는 null 객체를 None로 표현한다.

if null_value is None:
	print("비었어")

이렇게 쓰면된다.

 

보통 유효한 값을 확인할 때는 is를 쓴다.

반응형