LogFAQs > #912140858

LurkerFAQs, Active DB, DB1, DB2, DB3, Database 4 ( 07.23.2018-12.31.2018 ), DB5, DB6, DB7, DB8, DB9, DB10, DB11, DB12, Clear
Topic List
Page List: 1
TopicMy weekly programming help topic (Python)
LookANinja
11/09/18 11:34:23 PM
#24:


TheAnthraxBunny posted...
Also, there's a super condensed way of doing this using sorted() and negative indices. If you want to challenge yourself, you should be able to make this same program in no more than 3 lines.

I think i can kinda conceptualize it in my head. Let me know if i'm on the right track.

Basically, sort the list in either ascending or descending order
print list[0] for max (if descending)
print list[-1] for min (if descending)
---
... Copied to Clipboard!
Topic List
Page List: 1