Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  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))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement