0
what dose * mean
8 Respuestas
+ 2
* is the operator for multiplication
+ 1
* is for multiplication
0
thanks
0
* means multiplication
0
* means multiply
0
Pretty much means times or multiply
0
davidsonjes : not exactly, though. try "a"*10 or [1]*10
- 1
It means (under the hood), when you do a*b:
It tries to do a.__mult__(b) if there is a dunder __mult__ in the class of a.
If it is not there, it tries b.__rmult__(a).
If there is still not an operator for a*b, it raises an Error.
A dunder a a __double under__ method that can be overwritten and that gives you ability to used shorter notations (see my example with generalised type, not just int)