[Tutor] dictionary datatype

kakada hokkakada at khmeros.info
Wed Apr 12 05:19:22 CEST 2006


Hello all,

For example, I have a dictionary:
dict1 = { 0x2018:u'k', 0x2019:u'd'}

I assign:
n = 0x2018
print dict1[n]

Then:
KeyError: '0x2018'

But I can call directly:
print dict1[0x2018]

So, what is wrong with this? How can I solve it?

Thx

kakada


More information about the Tutor mailing list