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


Groups > comp.lang.python > #91891

Please help on this sorted function

Newsgroups comp.lang.python
Date 2015-06-02 13:20 -0700
Message-ID <37d9de72-b719-45a0-976c-441fc5898741@googlegroups.com> (permalink)
Subject Please help on this sorted function
From fl <rxjwg98@gmail.com>

Show all headers | View raw


Hi,

I try to learn sorted(). With the tutorial example:




>>> ff=sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'})
>>> ff
[1, 2, 3, 4, 5]



I don't see what sorted does in this dictionary, i.e. the sequence of 
1..5 is unchanged. Could you explain it to me?


Thanks,

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Please help on this sorted function fl <rxjwg98@gmail.com> - 2015-06-02 13:20 -0700
  Re: Please help on this sorted function fl <rxjwg98@gmail.com> - 2015-06-02 13:25 -0700
    Re: Please help on this sorted function Joonas Liik <liik.joonas@gmail.com> - 2015-06-02 23:42 +0300
      Re: Please help on this sorted function Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-03 18:21 +1000
    Re: Please help on this sorted function Chris Angelico <rosuav@gmail.com> - 2015-06-03 10:01 +1000
  Re: Please help on this sorted function Joonas Liik <liik.joonas@gmail.com> - 2015-06-02 23:32 +0300
  Re: Please help on this sorted function Gary Herron <gherron@digipen.edu> - 2015-06-02 14:00 -0700

csiph-web