mirror of
https://bitbucket.org/Mattrixwv/projecteulerpython.git
synced 2025-12-06 17:43:58 -05:00
Updated result to function
This commit is contained in:
@@ -71,19 +71,18 @@ class Problem5(Problem):
|
||||
#Stop the timer
|
||||
self.timer.stop()
|
||||
|
||||
#Save the results
|
||||
if(currentNum < 0):
|
||||
self.result = "There was an error: Could not find a number that fit the criteria"
|
||||
else:
|
||||
self.result = "The smallest positive number that is evenly divisible by all numbers 1-20 is " + str(self.smallestNum)
|
||||
|
||||
#Throw a flag to show the problem is solved
|
||||
self.solved = True
|
||||
#Reset the problem so it can be run again
|
||||
def reset(self):
|
||||
super().reset()
|
||||
self.smallestNum = 0
|
||||
|
||||
#Returns the result of solving the problem
|
||||
def getResult(self):
|
||||
#If the problem hasn't been solved throw an exception
|
||||
if(not self.solved):
|
||||
raise Unsolved("You must solve the problem before you can see the result")
|
||||
return "The smallest positive number that is evenly divisible by all numbers 1-20 is " + str(self.smallestNum)
|
||||
#Gets
|
||||
#Returns the requested number
|
||||
def getNumber(self) -> int:
|
||||
|
||||
Reference in New Issue
Block a user