+ 1

what is this (x,*a) and (x,**a)?

if i make def like this def name (x,*a) or def name (x,**a) what this "stars" do ?

5th Nov 2017, 9:58 AM
khaled Fathi
khaled Fathi - avatar
2 Answers
+ 6
It's a notation for packing/unpacking arguments: single '*' pack arguments in a list, while double '**' pack named arguments in a dict... http://hangar.runway7.net/JUMP_LINK__&&__python__&&__JUMP_LINK/packing-unpacking-arguments
5th Nov 2017, 10:20 AM
visph
visph - avatar
+ 1
thank you
5th Nov 2017, 12:10 PM
khaled Fathi
khaled Fathi - avatar