1. Which of the following statements is true? *
In Python, same operator may behave differently depending upon operands.
O You can change the way operators behave in Python.
O Special method _add()__ is called when + operator is used.
O All of the above.
Answers
Answered by
2
Answer:
You can change the way operators behave in Python.
Explanation:
please follow me
Answered by
0
All of the above statements are true. Because we can change the way operators behave in Python. the same operator may behave differently depending upon operands.
About Python operator overloading :
- Python allows us to change an operator's default behavior based on the operands we use. "Operator overloading" is the term for this practice.
- When you use + on two objects in Python, the __add__() function explains what happens.
- Operator overloading is not limited to arithmetic operators in Python. We can also overburden comparison operators. Overloading an operator refers to giving them more meaning than their established operational meaning.
Similar questions