iF(2)
-
조건문 [ Javascript ] [ JavaScript 문법 종합반 1주차 ]
// 문(if, else if, switch ~~) // 조건문 - if, else if, else switch // 1 if // 1-1 let x = 10; if (x > 0) { //main logic console.log("x 는 양수입니다."); } // 1-2 let y = "hello world"; if (y.length >= 5) { console.log(y.length); } // 2 if-else x = 10; if (x > 0) { console.log("x 는 양수입니다"); } else { console.log("x 는 음수입니다"); } // if - else if - else x = 10; if (x = 0 ..
2023.06.12 -
5. if
weather = input("오늘 날씨는 어때요? ") # 눈 if weather == "비" or weather == "눈": print("우산을 챙기세요") elif weather == "미세먼지": print("마스크를 챙기세요") else: print("준비물 필요 없어요.") ''' 우산을 챙기세요 ''' # input 은 항상 문자열로 값을 받는다. temp = int(input("기온은 어때요 ? ")) # 5 if 30
2023.05.02