Bengt Richter wrote:
On Wed, 09 Nov 2005 00:42:45 GMT, Ron Adam [EMAIL PROTECTED] wrote:
Bengt Richter wrote:
On 08 Nov 2005 08:07:34 -0800, Paul Rubin http://[EMAIL PROTECTED] wrote:
dcrespo [EMAIL PROTECTED] writes:
hex(255)[2:]
'ff'
'%x'%255 is preferable since the format of
I try this command:
import string
string.atoi('78',16)
120
this is 120 not 4E.
Someone can tell me how to convert a decimal number to hex number? Can
print A, B, C,DEF.
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
Hi!
Try hex:
hex(120)
'0x78'
Consider converting string - int using the int()-function:
print int.__doc__
int(x[, base]) - integer
Convert a string or number to an integer, if possible. A floating point
argument will be truncated towards zero (this does not include a string
representation of
And if you want only the hex number, try:
hex(255)[2:]
'ff'
--
http://mail.python.org/mailman/listinfo/python-list
dcrespo [EMAIL PROTECTED] writes:
hex(255)[2:]
'ff'
'%x'%255 is preferable since the format of hex() output can vary. Try
hex(33**33).
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
dcrespo [EMAIL PROTECTED] writes:
hex(255)[2:]
'ff'
'%x'%255 is preferable since the format of hex() output can vary. Try
hex(33**33).
?
You're usually smarter than this, or am I missing some joke?
hex(33*33)
'0x441'
hex(33*33)[2:]
'441'
33*33
1089
%x %
Steve Holden [EMAIL PROTECTED] 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'
--
Paul Rubin wrote:
Steve Holden [EMAIL PROTECTED] 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)
On 08 Nov 2005 08:07:34 -0800, Paul Rubin http://[EMAIL PROTECTED] wrote:
dcrespo [EMAIL PROTECTED] writes:
hex(255)[2:]
'ff'
'%x'%255 is preferable since the format of hex() output can vary. Try
hex(33**33).
Not to mention ([EMAIL PROTECTED] deleted ;-)
hex(-255)[2:]
'xff'
hex(-255)
Bengt Richter wrote:
On 08 Nov 2005 08:07:34 -0800, Paul Rubin http://[EMAIL PROTECTED] wrote:
dcrespo [EMAIL PROTECTED] writes:
hex(255)[2:]
'ff'
'%x'%255 is preferable since the format of hex() output can vary. Try
hex(33**33).
Not to mention ([EMAIL PROTECTED] deleted ;-)
On Wed, 09 Nov 2005 00:42:45 GMT, Ron Adam [EMAIL PROTECTED] wrote:
Bengt Richter wrote:
On 08 Nov 2005 08:07:34 -0800, Paul Rubin http://[EMAIL PROTECTED] wrote:
dcrespo [EMAIL PROTECTED] writes:
hex(255)[2:]
'ff'
'%x'%255 is preferable since the format of hex() output can vary. Try
11 matches
Mail list logo