Stargaming <[EMAIL PROTECTED]> writes:
> It does not turn into something. The `sort()` method just works "in
> place", i. e. it will mutate the list it has been called with. It
> returns None (because there is no other sensible return value).
>
> For you, that means: You don't have to distinguish
On Fri, 13 Jul 2007 21:13:20 +0300, Bjoern Schliessmann
<[EMAIL PROTECTED]> wrote:
>
> Daniel wrote:
>
>> db is out of scope, you have to pass it to the function:
>
> What's wrong about module attributes?
>
I made a mistake
--
http://mail.python.org/mailman/listinfo/python-list
Daniel wrote:
> db is out of scope, you have to pass it to the function:
What's wrong about module attributes?
Regards,
Björn
--
BOFH excuse #418:
Sysadmins busy fighting SPAM.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 13 Jul 2007 20:44:13 +0300, <[EMAIL PROTECTED]> wrote:
>
> Hi!
> My code is
>
> > db = {}
> >
>> def display():
>> keyList = db.keys()
>> sortedList = keyList.sort()
>> for name in sortedList:
>> line = 'Name: %s, Number: %s' % (name, db[name])
>> print line.r
[EMAIL PROTECTED] schrieb:
> Hi!
> My code is
>
> > db = {}
> >
>
>> def display():
>> keyList = db.keys()
>> sortedList = keyList.sort()
>> for name in sortedList:
>> line = 'Name: %s, Number: %s' % (name, db[name])
>> print line.replace('\r', '')
>
>
> And it giv
Hi!
My code is
> db = {}
>
> def display():
> keyList = db.keys()
> sortedList = keyList.sort()
> for name in sortedList:
> line = 'Name: %s, Number: %s' % (name, db[name])
> print line.replace('\r', '')
And it gives following error:
> for name in sortedList:
>