간단한 논리 연산

송용진·2023년 9월 15일
0

알고리즘

목록 보기
126/173

boolean 변수 x1, x2, x3, x4가 매개변수로 주어질 때,
다음의 식의 true/false를
return 하는 solution 함수를 작성해 주세요.

(x1 ∨ x2) ∧ (x3 ∨ x4)

내 코드

def solution(x1, x2, x3, x4):
    answer = True
    answer = (x1 or x2) and (x3 or x4)
    return answer

예시 코드

def solution(x1, x2, x3, x4):
    return (x1 | x2) & (x3 | x4)
profile
백엔드 개발자

0개의 댓글