Merge pull request #244 from D-T-666/master

making makeReadme.py a fully automated script.
This commit is contained in:
Luke Weiler
2020-10-19 09:57:03 -04:00
committed by GitHub
6 changed files with 174 additions and 190 deletions

View File

@@ -40,11 +40,12 @@ def matrixMultiplicationFuncHelper(inp):
m = len(inp)
n = len(inp[0])
string = ""
string = "[["
for i in range(m):
for j in range(n):
string += f"{inp[i][j]: 6d}"
string += " "
string += "\n"
string += ", "if j < n-1 else ""
string += "]\n [" if i < m-1 else ""
string += "]]"
return string

View File

@@ -4,7 +4,7 @@ from .__init__ import *
def moduloFunc(maxRes=99, maxModulo=99):
a = random.randint(0, maxModulo)
b = random.randint(0, min(maxRes, maxModulo))
c = a % b
c = a % b if b != 0 else 0
problem = str(a) + "%" + str(b) + "="
solution = str(c)

View File

@@ -12,3 +12,5 @@ def profitLossPercentFunc(maxCP = 1000, maxSP = 1000):
percent = diff/cP * 100
problem = f"{profitOrLoss} percent when CP = {cP} and SP = {sP} is: "
solution = percent
return problem, solution