aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts
diff options
context:
space:
mode:
authorGravatar Objectivitix <[email protected]>2021-05-09 14:00:08 -0400
committerGravatar GitHub <[email protected]>2021-05-09 14:00:08 -0400
commit1854cd45dc4b79bed492a95bd00bcadf8ff116af (patch)
tree6df3d10554d16a8d576b211fd2feb61ce5d70e42 /bot/exts
parentfixed weird 8-space indents on lines 556-558 (diff)
use random.sample for more concise expression on line 66
Co-authored-by: Anand Krishna <[email protected]>
Diffstat (limited to 'bot/exts')
-rw-r--r--bot/exts/evergreen/trivia_quiz.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/bot/exts/evergreen/trivia_quiz.py b/bot/exts/evergreen/trivia_quiz.py
index 5553898d..620a4377 100644
--- a/bot/exts/evergreen/trivia_quiz.py
+++ b/bot/exts/evergreen/trivia_quiz.py
@@ -63,8 +63,7 @@ def linear_system(q_format: str, a_format: str) -> Tuple[str, str]:
x, y = random.randint(2, 5), random.randint(2, 5)
answer = a_format.format(x, y)
- nums = [i for i in range(1, 6)]
- coeffs = [nums.pop(random.randint(0, len(nums) - 1)) for _ in range(4)]
+ coeffs = random.sample(range(1, 6), 4)
question = q_format.format(
coeffs[0],