728x90 반응형 Else2 (Python) 반복문 (for, while) 지정한 조건만큼 반복적으로 실행할 때 사용합니다 🔁 forfor 변수 in 조건: 명령문 예제 for i in range(10) print(i)""" 출력0 1 2 3 4 5 6 7 8 9""" 🔁 for ~ elsefor 변수 in 조건: 명령문 else: 명령문예제for i in range(10) print(i) else: print("전부 출력 되었습니다")""" 출력0 1 2 3 4 5 6 7 8 9전부 출력 되었습니다""" 굳이 필요한지는 잘 모르겠다 🔁 for ~ break ~ elsefor 변수 in 조건: 명령문 break else: 명령문예제for i in range(10) print(i) break else: print("전부 출력 되었습니다")""" 출력.. 2024. 10. 22. (VBA) 조건문 중 "IF" 알아보기 - If() 🚰 IF문 구조 If [조건] [연산자] [조건] Then [명령어] Else if [명령어] Else [명령어] End If 조건이 한가지만 있을 경우 If [조건] [연산자] [조건] Then [명령어] 번호를 입력하면 색깔이 바뀌는 명령어입니다 Private Sub CommandButton1_Click() If Range("B8").Value = 1 Then Range("D8").Interior.Color = RGB(255, 0, 0) ElseIf Range("B8").Value = 2 Then Range("D8").Interior.Color = RGB(255, 165, 0) ElseIf Range("B8").Value = 3 Then Range("D8").Interior.Color = RGB(25.. 2023. 8. 5. 이전 1 다음 728x90 반응형