On 4 October 2010 18:43, Gopalakrishnan Subramani <[email protected]> wrote: > I don't think, I will be giving you the complete working code, here is > sample one. > > sites = { > 0: "<<BBCLink>>", > 1: "<<CricInfoLink>>" > } > > X= input('BBC Cricket News:1 , Cricinfo Cricket News:2 \n enter your choice: > ') > > if sites.has_key((int(X)):
has_key function for dicts is deprecated and not present in 3.x at all. Just use - int(X) in sites Apparently, 'in' is also faster than 'has_key' Regards, Nitin _______________________________________________ BangPypers mailing list [email protected] http://mail.python.org/mailman/listinfo/bangpypers
