> For example, I have a dictionary:
> dict1 = { 0x2018:u'k', 0x2019:u'd'}
> 
> I assign:
> n = 0x2018
> print dict1[n]
> 
> Then:
> KeyError: '0x2018'

The error is complaining that you are using a string as a key.
Are you sure you aren't assigning

n = '0x2018'

Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to