] [python] new_p = 1 if h & 8 else 0
본문 바로가기

카테고리 없음

[python] new_p = 1 if h & 8 else 0

new_p = 1 if h & 8 else 0

-->new_p의 값은 0인데

print("p1") if h & 8 else print("p0)

--> 이 줄의 결과값은 p1이다. 무슨차이?