if (1) 썸네일형 리스트형 [파이썬] if, elif, else 구문 파이썬에는 if(만약에) 관련 3가지 구문이 있다. if(만약에), elif(만약에2~), else(그 나머지는) 예시는 아래와 같다. weather = input("Enter weather (sunny, rainy, snowy): ") if weather.lower() == "sunny": print("Wear a t-shirt") #해가뜨는 날이면 t-Shirt를 입어라 elif weather.lower() == "rainy": print("Bring an umbrella and boots") #비가오는 날이면, 우산과 부츠를 가져가라 elif weather.lower() == "snowy": print("Wear a warm coat and hat") #눈이 오는 날이면, 코트와 모자.. 이전 1 다음