Home > Enterprise >  Python args and kwargs without too much explanation, code on one side and understand
Python args and kwargs without too much explanation, code on one side and understand

Time:09-17

Def list2 (a, b, * args, * * kwargs) :
Print (" * * * * * * * * list2 * * * * * * * * ")
Print (a)
Print (b)
Print (args)
Print (kwargs)
Def list1 (a, b, * args, * * kwargs) :
Print (' * * * * * * * * * * * list1 * * * * * * * * ')
Print (a)
Print (b)
Print (args)
Print (kwargs)
Print (" print list2 ")
List2 (a, b, args, kwargs)
Print (" print list2 second ")
List2 (a, b, * args, kwargs)
Print (" list2 third ")
List2 (a, b, * args, * * kwargs)
List1 (22, 44, 'han', 'shu' name='huanyu', nianling=29)
  • Related