Types of operators in Python 3 | Unary operators in Python 3

Types of operators in Python 3 | Unary operators in Python 3

Operator

It is the symbol used to perform some calculation or manipulation on variables , literals or expressions.

Operand

It is the variable, literal or expression on which an operator performs some operation.

Example:

9 + 8

In above expression, 9 and 8 are operands whereas + is an operator.

Types of Operators in Python 3

Operators are of various types:

1. Unary Operators in Python

These are the operators which can have single operand. They are of following types:-

Unary Plus (+)

It is used to specify that the number is positive. It is an optional sign as the number without any sign is automatically considered positive.

Examples:

+10 , 3.56

Unary Minus (-)

It is used to specify that the number is negative. Minus(-) must be written before a number to specify that it is a negative number.

Examples:

-10, -3.56

 

Spread the love
Lesson tags: python operators, Types of operators in Python 3, Unary operators in Python 3, unary operators of python
Back to: Python Programming Tutorial
Spread the love