SHARE
TWEET

Untitled

a guest Oct 21st, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #input
  2. a = [[3,-1],[7,8,9],[10,11,15,12,15]]
  3. #main
  4. MAX = max(a,key=len)    #find the longest list
  5. MIN = min(a,key=len)    #find the shortest list
  6. b = len(MAX)            #find the longest list's length
  7. c = len(MIN)            #find the shortest list's length
  8. d = MAX.index(max(MAX)) #find the longest list's maximum's index
  9. e = MIN.index(min(MIN)) #find the shortest list's minimum's index
  10. print("(%d %d %d %d)" %(b,d,c,e))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top