Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95431 > unrolled thread

Re: Python 3 sort() problem

Started byFabien <fabien.maussion@gmail.com>
First post2015-08-17 16:12 +0200
Last post2015-08-17 16:12 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Python 3 sort()  problem Fabien <fabien.maussion@gmail.com> - 2015-08-17 16:12 +0200

#95431 — Re: Python 3 sort() problem

FromFabien <fabien.maussion@gmail.com>
Date2015-08-17 16:12 +0200
SubjectRe: Python 3 sort() problem
Message-ID<mqsq4l$bq2$1@speranza.aioe.org>
On 08/17/2015 01:42 PM, Владислав wrote:
> x = [1, 2, 4, 2, 1, 3]
> x = list(set(x)).sort()
> print(x) /# output: None/
>
> I know that sort() returns None, but I guess that it would be returned x
> that was sorted. Why so?

If sort() returns None, than the following:

x = list(set(x)).sort()

is equivalent to writing:

x = None

So I don't really understand your question, I'm sorry...

Cheers,

Fabien

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web