How is 'unary +' operator different from '+' operator? How is 'unary -' operator different from ' - ' operator in python.
Answers
Answered by
5
Answer:
unary+and unary- are unary operators:-
1) the operator unary+ precedes an operand. the operand (the value on which the operator operates)of the unary + operator must have arithmetic type and the result is the value of the argument.
2) the operator unary- precedes an operand. the operand of the unary- operator must have arithmetic type and the result is the negation of its operand's value
'-' operator and'+'operator are binary operators:-
1) the arithmetic binary operator + adds values of its operand's and the result is the sum of the values of its two operands.
2) the - operator subtracts the second operand from the first.
Similar questions