강의

멘토링

커뮤니티

Inflearn Community Q&A

dongwan8173613's profile image
dongwan8173613

asked

Getting Started with Programming: Introduction to Python (Inflearn Original)

if statement (1-3)

if Flase: print('Bad')

Written on

·

45

0

 안녕하세요 강사님 단순한 질문이겠지만 궁금해서 한가지 질문드립니다.

아래와 같이 코드를 치면 False이면 bad가 출력이 되어야하는게 아닌가 궁금합니다.

 

한글로 풀이 했을 때 False면 bad를 출력해라 인데 왜 아무것도 출력이 안되는걸까요?

if False:     
    print('Bad')
python선물하기-좋은

Answer 1

0

niceman님의 프로필 이미지
niceman
Instructor

기존은 false로 해석됩니다.

 

if not False:

print('Bad')

 

또는 else 문등으로 출력가능해요.

기본적이면서도 중요한 질문 해주셨네요

dongwan8173613's profile image
dongwan8173613

asked

Ask a question