How to convert a number to hex number?

Paul Rubin http
Tue Nov 8 16:20:48 EST 2005


Steve Holden <steve at holdenweb.com> writes:
> > Try hex(33**33).
> 
> You're usually smarter than this, or am I missing some joke?
> 
>   >>> hex(33*33)
> '0x441'

You used only one * (multiplication), I used two *'s (exponentiation).

    >>> hex(33**33)
    '0x5857366DCE0162CB5DDCD1BF0FC7C03A6438304421L'



More information about the Python-list mailing list