How is * args accessed inside a function ? The answer is args without asterisk!An interesting and wise question. I like it. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How is * args accessed inside a function ? The answer is args without asterisk!An interesting and wise question. I like it.

2nd Apr 2018, 1:53 PM
Vučko/Вучко/Vuchko
Vučko/Вучко/Vuchko - avatar
8 Answers
+ 6
We did not understand. I did not mean to hurt you. I do not think you're malicious. Thanks for the advice, man!
2nd Apr 2018, 2:47 PM
Vučko/Вучко/Vuchko
Vučko/Вучко/Vuchko - avatar
+ 5
On my page, everything that teaches us something with fun or trick is worth starting a post. What is seen is that you have spoken with your malicious commentary :). Do you agree with me, young gentleman?
2nd Apr 2018, 2:06 PM
Vučko/Вучко/Vuchko
Vučko/Вучко/Vuchko - avatar
+ 4
Yes the values are are later on wrapped into a tuple and then passed
2nd Apr 2018, 5:45 PM
Mitali
Mitali - avatar
+ 3
*arg is taken as a tuple.
2nd Apr 2018, 5:31 PM
Mitali
Mitali - avatar
+ 2
after its passed into the function it works as a tuple but you don't have to input it as a tuple. def test(arg1, arg2, *args) print(arg2, arg1) print(args) test(1,2,3,4,5,6)
2nd Apr 2018, 5:37 PM
Markus Kaleton
Markus Kaleton - avatar
+ 1
was this really worth starting a post ?
2nd Apr 2018, 1:58 PM
Markus Kaleton
Markus Kaleton - avatar
+ 1
Well its good to know and obvious, also i'm 90% sure that this is included in the lessons here. I'm not malicious, I'm questioning the need of this post, since if this is missing from the functional programming lessons the right place for this would be the sololearn feedback section instead of the Questions and Answers section since here it will disappear in a few days where as in lessons it would be always available.
2nd Apr 2018, 2:14 PM
Markus Kaleton
Markus Kaleton - avatar
+ 1
As the tuple args
13th Jul 2023, 2:43 PM
Mounir Charif
Mounir Charif - avatar