Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: Operators in Python
skuchekar

Date:
Operators in Python
Permalink   


In Python, operators are symbols or keywords used to perform operations on variables or values. They are categorized into several types:

1. Arithmetic Operators

These are used to perform basic arithmetic operations.

Addition

Subtraction

Multiplication

Division (returns a float)

Floor division (returns an integer, rounds down)

Modulus (returns the remainder of division)

Exponentiation (raises a number to a power)

 

2. Comparison (Relational) Operators

These operators are used to compare two values and return a boolean value (True or False).

Equal to

Not equal to

Greater than

Less than

Greater than or equal to

Less than or equal to

3. Logical Operators

 

These are used to combine conditional statements and return a boolean result.

Returns True if both statements are true

Returns True if at least one statement is true

Reverses the logical state of its operand (if it's True, it becomes False)

 

4. Assignment Operators

These are used to assign values to variables.

Assigns value

Add and assign

Subtract and assign

Multiply and assign

Divide and assign

Floor divide and assign

Modulus and assign

Exponentiate and assign

 

Python Classes in Nanded

Operators in Python

Python Course in Nanded

 



__________________
Page 1 of 1  sorted by
Quick Reply

Please log in to post quick replies.

Tweet this page Post to Digg Post to Del.icio.us


Create your own FREE Forum
Report Abuse
Powered by ActiveBoard