Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Answer to the Ultimate Question of Life, the Universe, and Everything solution in Creative category for The Best Number Ever by MichalMarsalek
from datetime import date
class DeepThought:
__year_started__ = None
__time_shift__ = 0
__result__ = None
def time_travel(self, years):
self.__time_shift__ += years
def __current_year__(self):
return date.today().year+self.__time_shift__
def compute_answer_to_the_ultimate_question_of_life_the_universe_and_everything(self):
self.__year_started__ = date.today().year
def get_the_answer(self):
calculation_lasting = self.__current_year__() - self.__year_started__
if calculation_lasting >= 7500000:
self.__result__ = len("The answer to life, the universe and everything is".replace(" ",""))
return self.__result__
def checkio():
deep_thought = DeepThought()
deep_thought.compute_answer_to_the_ultimate_question_of_life_the_universe_and_everything()
while True:
deep_thought.time_travel(100)
answer = deep_thought.get_the_answer()
if answer:
return answer
Aug. 16, 2015
Comments: