mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
27 lines
607 B
Python
27 lines
607 B
Python
from .__init__ import *
|
|
|
|
|
|
def compareFractionsFunc(maxVal=10):
|
|
a = random.randint(1, maxVal)
|
|
b = random.randint(1, maxVal)
|
|
c = random.randint(1, maxVal)
|
|
d = random.randint(1, maxVal)
|
|
|
|
while (a == b):
|
|
b = random.randint(1, maxVal)
|
|
while (c == d):
|
|
d = random.randint(1, maxVal)
|
|
|
|
first = a / b
|
|
second = c / d
|
|
|
|
if(first > second):
|
|
solution = ">"
|
|
elif(first < second):
|
|
solution = "<"
|
|
else:
|
|
solution = "="
|
|
|
|
problem = f"Which symbol represents the comparison between {a}/{b} and {c}/{d}?"
|
|
return problem, solution
|