From 6079b20c2988f208af27c18886d76ac82017e15b Mon Sep 17 00:00:00 2001 From: Vhizux Date: Sun, 25 Oct 2020 22:03:12 +0100 Subject: [PATCH] lint fix --- .vscode/settings.json | 5 +++++ mathgenerator/funcs/binomial_distribution.py | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9fadd3a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "python.linting.pylintEnabled": false, + "python.linting.flake8Enabled": true, + "python.linting.enabled": true +} \ No newline at end of file diff --git a/mathgenerator/funcs/binomial_distribution.py b/mathgenerator/funcs/binomial_distribution.py index 8fc5f95..5a4e404 100644 --- a/mathgenerator/funcs/binomial_distribution.py +++ b/mathgenerator/funcs/binomial_distribution.py @@ -6,11 +6,11 @@ def factorial(n): if n == 1 or n == 0: return 1 else: - return n * factorial(n-1) + return n * factorial(n - 1) def newton_symbol(n, k): - return factorial(n) / (factorial(k) * factorial(n-k)) + return factorial(n) / (factorial(k) * factorial(n - k)) def binomialDistFunc(): @@ -31,12 +31,12 @@ def binomialDistFunc(): for i in range(0, rejections + 1): answer += newton_symbol(float(batch), float(i)) * ((rejected_fraction / 100.) ** float(i)) * \ - ((1 - (rejected_fraction/100.)) ** (float(batch)-float(i))) + ((1 - (rejected_fraction / 100.)) ** (float(batch) - float(i))) answer = round(100 * answer, 2) return problem, answer -binomial_distribution = Generator("Binomial distribution", 107, +binomial_distribution = Generator("Binomial distribution", 107, "P(X