+ 3
* mark
Whatâs the meaning of * in python thanks
3 Answers
+ 12
multiplication
+ 3
+ 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