mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
25 lines
664 B
Python
25 lines
664 B
Python
from .__init__ import *
|
|
|
|
|
|
def IsLeapYear(minNumber=1900, maxNumber=2099):
|
|
year = random.randint(minNumber, maxNumber)
|
|
problem = "Year " + str(year) + " "
|
|
solution = ""
|
|
if (year % 4) == 0:
|
|
if (year % 100) == 0:
|
|
if (year % 400) == 0:
|
|
solution = "is a leap year"
|
|
else:
|
|
solution = "is not a leap year"
|
|
else:
|
|
solution = "is a leap year"
|
|
else:
|
|
solution = "is not a leap year"
|
|
|
|
return problem, solution
|
|
|
|
|
|
is_leap_year = Generator("Leap Year or Not", 101,
|
|
IsLeapYear,
|
|
["minNumber=1900", "maxNumber=2099"])
|