Feb-29-2024, 08:01 AM
hi
I saw the below snippet cod in a quiz on the net:
in that quiz, the output of line 2 had been required.
my question:
how can I know that an operator such as(+,*,- or /) can be used with a type( as string, list, tuple,...) and what is the result of it?
thanks
I saw the below snippet cod in a quiz on the net:
1 2 3 |
my_list = [ 1 , 2 , 3 ] print (my_list * 3 ) print ( 3 * my_list) |
my question:
how can I know that an operator such as(+,*,- or /) can be used with a type( as string, list, tuple,...) and what is the result of it?
thanks