Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Rosetta Code: Long List is Long -- Python

by parv (Parson)
on Dec 10, 2022 at 04:51 UTC ( [id://11148702]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    def sort_native( cat_count ):
       once = sorted( cat_count.keys() )
       return sorted( once, key = lambda k: cat_count[ k ], reverse = True
    + )
    
  2. or download this
    sort { $href->{$b} <=> $href->{$a} } sort keys %{$href}
    
  3. or download this
    def sort_native( cat_count :dict[ str, int ] ) ->list[ str ]:
       """
    ...
       """
       once = sorted( cat_count.keys() )
       return sorted( once, key = lambda k: cat_count[ k ], reverse = True
    + )
    
  4. or download this
    #!/usr/local/bin/python3.10
    # Source: https://perlmonks.org/index.pl?node_id=11148702
    ...
                                 time = time, time_format = time_format
                               )
       sys.stderr.write( mess )
    
  5. or download this
    # parv-20221210-two-sorts.py
    collect        : 15.9 s
    ...
    stringification:  7.5 s
    output         :  0.1 s
    total          : 31.3 s
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148702]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-24 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found