match-case문1 24.02.17 정올 파이썬 선택 제어문 1) if elif else 문 반복문처럼 선택제어문을 사용할 때에도 다중 조건문을 사용하지 않는 것이 좋습니다. 다중 조건문 대신 논리 연산자를 사용한 예제 ▼ a,b=input().split() b=int(b) if a=='F' and b>=18: print('WOMAN') elif a=='F' and b=18: print('MAN') else: print('BOY') '''입력 F 15 ''' """출력 GIRL """ 2) switch-case 문처럼 쓰는 match-case 문 파이썬 3.10에 match-case 구문이 추가됐습니다. match-case 문은 switch-case문처럼 'switch 공식:case 답: '형식으로 사용합니다. c++의 switch-case문과 달리 break문을.. 2024. 2. 18. 이전 1 다음