mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
Update mathgen.py
This commit is contained in:
23
mathgen.py
23
mathgen.py
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user