Yup, thanks a lot ... it works now ! >>> results = { "gengyang": 14, "ensheng": 13, "jordan": 12 } >>> results["jordan"] 12
On Tuesday, November 24, 2015 at 6:40:26 PM UTC+8, Peter Otten wrote: > Cai Gengyang wrote: > > > Strange, it gives me an error message when i type result["jordan"] or > > result[max(result)] though : > > > >>>> results = { > > "gengyang": 14, > > "ensheng": 13, > > "jordan": 12 > > } > > > >>>> result["jordan"] > > Traceback (most recent call last): > > File "<pyshell#27>", line 1, in <module> > > result["jordan"] > > NameError: name 'result' is not defined > > Yeah, the error message really should be > > "NameError: name 'result' is not defined; did you mean 'results'?" > > ;) -- https://mail.python.org/mailman/listinfo/python-list