개발로그필름

[python] if문 예제 본문

IT/Python

[python] if문 예제

yuullog 2022. 11. 26. 09:19
728x90
반응형
SMALL

 

weather = input("오늘 날씨는 어때요? ")
if weather == "비" or weather == "눈":
    print("우산을 챙기세요")
elif weather == "미세먼지":
    print("마스크를 챙기세요")
else:
    print("준비물 필요 없어요")

temp = int(input("기온은 어때요? "))
if 30 <= temp:
    print("너무 더워요. 나가지 마세요")
elif 10 <= temp and temp < 30:
    print("괜찮은 날씨에요")
elif 0 <= temp < 10:
    print("외투를 챙기세요")
else:
    print("너무 추워요. 나가지 마세요")

 

 

반응형
LIST

'IT > Python' 카테고리의 다른 글

[python] 자료구조 변경  (0) 2022.11.28
[python] 파이썬 퀴즈  (0) 2022.11.27
[python] for문 예제  (0) 2022.11.25
[python] while문 예제  (0) 2022.11.24
[python] 전달값과 반환값  (0) 2022.11.23
Comments