Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. # Getting maximum from iterable
  2. >>> a = [1, 2, -3]
  3. >>> max(a)
  4. 2
  5.  
  6. # Getting maximum from iterable
  7. >>> min(a)
  8. 1
  9.  
  10. # Bot min/max has key value to allow to get maximum by appliing function
  11. >>> max(a,key=abs)
  12. 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement