Create signum_function.py

This commit is contained in:
Gautam Prasad
2020-10-24 06:08:28 +05:30
committed by GitHub
parent 5217590f28
commit 1235b4c424

View File

@@ -0,0 +1,19 @@
from .__init__ import *
import random
def signumFunc(min=-999, max=999):
a = random.randint(min, max)
b = 0
if (a > 0):
b = 1
if (a < 0):
b = -1
problem = "signum of " + str(a) + " is " + "="
solution = str(b)
return problem, solution
signum_function = Generator("signum function", 106,
"signum function of a is", "b",
signumFunc)