hex numbers??

Chris Kassopulo ckasso at sprynet.com
Tue Sep 24 21:57:22 EDT 2002


On Tue, 24 Sep 2002 12:30:48 -0300 (GMT-03:00)
jubafre at brturbo.com wrote:

> 
> x = [12,13,14]
> y = ['0xc', '0xd', '0xe']
> 
> hex() create a list of string,  how i can write in a file just the
> real value of hexadecimal number?
> 

x = [12,13,14]
y = []
for char in x:
	y.append(str(hex(char)).replace ('0x','',1))
print y 	

['c', 'd', 'e']

Chris Kassopulo



More information about the Python-list mailing list