Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Euler's (almost) identity in Python solution in Creative category for The Best Number Ever by juestr
from math import e, pi
def checkio():
# this has it all, e, pi and j
# the most beautiful formula in math
eulers_identity = e ** (1j * pi) + 1
# in math this is equal to zero
# in python we have to live with imperfection
return eulers_identity
if __name__ == '__main__':
# These "asserts" using only for self-checking and not necessary for auto-testing
assert isinstance(checkio(), (int, float, complex))
April 12, 2019
Comments: