added absolute difference

This commit is contained in:
himanshu1603
2020-10-19 12:16:18 +05:30
parent 3ba50015ef
commit cb2f3e7abe
2 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
from .__init__ import *
def absoluteDifferenceFunc (maxA = 100, maxB = 100):
a = random.randint(-1*maxA, maxA)
b = random.randint(-1*maxB, maxB)
absDiff = abs(a-b)
problem = "Absolute difference between numbers " + str(a) + " and " + str(b) + " = "
solution = absDiff
return problem, solution