We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The context determines what type of operator it is. Many languages overload symbols to mean more than just one operator. For example in C:
int*ptr=&y;*ptr=5;z=y*x;
* in the first instance declares a pointer variable
* in the second instance is called a dereference operator
* in the third instance is a multiplication operator.
So, from what I can tell about the comments above in Python:
What type of operator '*' is depends on its context.
*[1,2,3] the * is not the same as 2 * 3 where it is the multiplication operator.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Print Function
You are viewing a single comment's thread. Return to all comments →
The context determines what type of operator it is. Many languages overload symbols to mean more than just one operator. For example in C:
* in the first instance declares a pointer variable
* in the second instance is called a dereference operator
* in the third instance is a multiplication operator.
So, from what I can tell about the comments above in Python: What type of operator '*' is depends on its context.
*[1,2,3] the * is not the same as 2 * 3 where it is the multiplication operator.