Update mathgen.py

This commit is contained in:
Satyam Koshta
2020-10-19 14:32:43 +05:30
committed by GitHub
parent 2e55c7798a
commit eadc644e0d

View File

@@ -1,5 +1,24 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import random
genList = []
# || Generator class
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):