From f142920b3cf11f0166a6af2303ab6b9d42850052 Mon Sep 17 00:00:00 2001 From: MstrPikachu <31784486+MstrPikachu@users.noreply.github.com> Date: Sun, 3 Oct 2021 16:32:15 -0400 Subject: [PATCH] Remove redundant condition --- assignments/a2/a2_part2_q1_q2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assignments/a2/a2_part2_q1_q2.py b/assignments/a2/a2_part2_q1_q2.py index 235419d..46cee4d 100644 --- a/assignments/a2/a2_part2_q1_q2.py +++ b/assignments/a2/a2_part2_q1_q2.py @@ -71,7 +71,7 @@ def mystery_2a_no_if(x: int, y: int, z: set[int]) -> bool: def mystery_2b_no_if(n: int) -> bool: """Return the same value as mystery_2b_if, but without using any if statements.""" - return (n % 2 == 0 and n % 3 == 1) or (n % 2 == 1 and ((n <= 4 and n < 0) or (n > 4 and n % 3 != 1))) + return (n % 2 == 0 and n % 3 == 1) or (n % 2 == 1 and (n < 0 or (n > 4 and n % 3 != 1))) def mystery_2c_no_if(c1: int, c2: int, c3: int) -> bool: