Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
000000 solution in Uncategorized category for The Best Number Ever by Miaou
import random
def checkio():
'And the best number ever is... 0 !'
# Yeah, I think 0 is the best number.
# 0 is THE real Chuck Norris of numbers...
nChuck = 0
# All numbers fear to be touched by Chuck, because they would
# become Chuck instantly:
for i in range(100000):
assert nChuck * random.random()*100000 == nChuck
assert nChuck / random.random()*100000 == nChuck
# (Chuck can touch himself ^^)
assert nChuck*nChuck == nChuck
# It would require infinite amount of energy to defeat Chuck:
try:
random.random()/nChuck
except ZeroDivisionError:
pass
# (Chuck attacking himself is not even predictable !)
try:
nChuck/nChuck
except ZeroDivisionError:
pass
# Chuck is invisible
assert 72 + nChuck == 72
# Chuck is everywhere, look carefully
assert 99 == nChuck + 99 + nChuck
# Chuck is the anti-prime number : it can be divided by one,
nChuck/1
# ... but not even by himself
try:
nChuck/nChuck
except ZeroDivisionError:
pass
# ... and can be divided by every other integers !
for i in range(100000):
j = int(random.random()*1e6)
assert nChuck%j == 0
# Chuck is so powerfull, some civilisations did not encoutered it !
return nChuck
April 28, 2013