Advertisement
Nenogzar

*args

May 28th, 2024
797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. def len_list(*args):
  2.     return len(args)
  3.  
  4.  
  5. list1 = [1, 2, 3]
  6. list2 = [4, 5]
  7. list3 = [6, 7, 8, 9]
  8.  
  9. matrix = [[1, 2, 3], [4, 5], [6, 7, 8, 9]]
  10. matrix1 = [[1, 2, 3], [4, 5], [6, 7, 8, 9]]
  11.  
  12. print(len_list(list1))
  13. print(len_list(*list1))
  14. print(len_list(*list1, *list2, *list3))
  15. print(len_list(*matrix))
  16. print(len_list(*matrix, *matrix1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement