From 9805f810910f4019f57b3c99d925641d8d386218 Mon Sep 17 00:00:00 2001 From: Satyam Koshta <58166232+satyamkoshta340@users.noreply.github.com> Date: Mon, 19 Oct 2020 11:32:01 +0530 Subject: [PATCH] Update mathgen.py --- mathgen.py | 58 +++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/mathgen.py b/mathgen.py index 6ee4b89..3eb6ea8 100644 --- a/mathgen.py +++ b/mathgen.py @@ -1,32 +1,32 @@ -import random -genList =[] -class Generator: - def __init__(self, title, id, generalProb, generalSol, func): - self.title = title - self.id = id - self.generalProb = generalProb - self.generalSol = generalSol - self.func = func - genList.append([id, title, self]) - def __str__(self): - return str(self.id) + " " + self.title + " " + self.generalProb + " " + self.generalSol - def __call__(self, **kwargs): - return self.func(**kwargs) +# import random +# genList =[] +# class Generator: +# def __init__(self, title, id, generalProb, generalSol, func): +# self.title = title +# self.id = id +# self.generalProb = generalProb +# self.generalSol = generalSol +# self.func = func +# genList.append([id, title, self]) +# def __str__(self): +# return str(self.id) + " " + self.title + " " + self.generalProb + " " + self.generalSol +# def __call__(self, **kwargs): +# return self.func(**kwargs) -def isprime(max_a =100): - a =random.randint(2,max_a) - problem =a - if a == 2: - solution = True - return problem,solution - if a % 2 == 0: - solution = False - return problem,solution - for i in range(3, a // 2 + 1, 2): - if a % i == 0: - solution = False - return problem, solution - solution = True - return problem, solution +# def isprime(max_a =100): +# a =random.randint(2,max_a) +# problem =a +# if a == 2: +# solution = True +# return problem,solution +# if a % 2 == 0: +# solution = False +# return problem,solution +# for i in range(3, a // 2 + 1, 2): +# if a % i == 0: +# solution = False +# return problem, solution +# solution = True +# return problem, solution is_prime = Generator("isprime", 61, "a any positive integer", "True/False", isprime())