+ 3

* mark

What’s the meaning of * in python thanks

23rd Jul 2021, 12:28 PM
de Jefferson
de Jefferson - avatar
3 Antworten
+ 12
multiplication
25th Jul 2021, 6:25 AM
Victorya
Victorya - avatar
+ 3
Haha - * is used for 3 things * -> multiply example - >>> 2 * 3 6 * -> taking many arguments example - >>> def sum(*args): ... sum = 0 ... for i in args: ... sum += 1 ... return sum >>> sum(2,3,4) 9 * -> Unpacking Example, >>> a = (1,2,3) >>> *a 1 2 3 >>> print(*a, sep='/') 1/2/3
23rd Jul 2021, 1:18 PM
Abhiyantā
Abhiyantā - avatar