Programming is indeed tough ... I wish I had picked up this skill much earlier
in life.
But true, I will try to research my questions more in depth before posting
here.
My goal eventually is to build a successful YCombinator based web-based
startup.
On Wednesday, November 25, 2015 at
On 25/11/2015 10:26, Cai Gengyang wrote:
But true, I will try to research my questions more in depth before posting here.
Please also research how to intersperse your answers or bottom post.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our
On Tuesday, November 24, 2015 at 9:29:30 AM UTC-5, Mark Lawrence wrote:
> On 24/11/2015 14:07, Denis McMahon wrote:
> > On Tue, 24 Nov 2015 02:04:56 -0800, Cai Gengyang wrote:
> >
> >> Here's a dictionary with 3 values :
> >>
> >> results = {
> >>"gengyang": 14,
> >>"ensheng": 13,
Here's a dictionary with 3 values :
results = {
"gengyang": 14,
"ensheng": 13,
"jordan": 12
}
How do I define a function that takes the last of the 3 items in that list and
returns Jordan's results i.e. (12) ?
Thanks a lot !
Gengyang
--
Cai Gengyang wrote:
> Here's a dictionary with 3 values :
>
> results = {
> "gengyang": 14,
> "ensheng": 13,
> "jordan": 12
> }
>
> How do I define a function that takes the last of the 3 items in that list
> and returns Jordan's results i.e. (12) ?
>
> Thanks a lot !
You can access the
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 "", line 1,
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
On Tue, Nov 24, 2015 at 9:04 PM, Cai Gengyang wrote:
> Here's a dictionary with 3 values :
>
> results = {
> "gengyang": 14,
> "ensheng": 13,
> "jordan": 12
> }
>
> How do I define a function that takes the last of the 3 items in that list
> and returns Jordan's
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 "", line 1, in
result["jordan"]
NameError:
On Tue, 24 Nov 2015 02:04:56 -0800, Cai Gengyang wrote:
> Here's a dictionary with 3 values :
>
> results = {
> "gengyang": 14,
> "ensheng": 13, "jordan": 12
> }
>
> How do I define a function that takes the last of the 3 items in that
> list and returns Jordan's results i.e. (12) ?
You
On 24/11/2015 14:07, Denis McMahon wrote:
On Tue, 24 Nov 2015 02:04:56 -0800, Cai Gengyang wrote:
Here's a dictionary with 3 values :
results = {
"gengyang": 14,
"ensheng": 13, "jordan": 12
}
How do I define a function that takes the last of the 3 items in that
list and returns
Its cool ... No problem
On Tuesday, November 24, 2015 at 7:05:25 PM UTC+8, Chris Angelico wrote:
> On Tue, Nov 24, 2015 at 9:35 PM, Peter Otten <__pete...@web.de> wrote:
> > Yeah, the error message really should be
> >
> > "NameError: name 'result' is not defined; did you mean 'results'?"
> >
>
On Tue, Nov 24, 2015 at 9:35 PM, Peter Otten <__pete...@web.de> wrote:
> Yeah, the error message really should be
>
> "NameError: name 'result' is not defined; did you mean 'results'?"
>
> ;)
Heh. Yes, that was my fault. Sorry Cai! it should have been
results["jordan"], as you figured out.
13 matches
Mail list logo