0% found this document useful (0 votes)
4 views1 page

Python Arithmetic and Logical Operators

The document explains arithmetic and logical operators in Python, detailing their functions and types. Arithmetic operators perform basic mathematical operations on numeric values, while logical operators combine conditions and return boolean values. Key points highlight the distinction between the two types of operators and their applications in programming.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Python Arithmetic and Logical Operators

The document explains arithmetic and logical operators in Python, detailing their functions and types. Arithmetic operators perform basic mathematical operations on numeric values, while logical operators combine conditions and return boolean values. Key points highlight the distinction between the two types of operators and their applications in programming.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Note on Arithmetic and Logical Operators in Python

1. Arithmetic Operators

Arithmetic operators in Python are used to perform basic mathematical operations. They work on
numeric values (integers, floats, etc.).

Types of Arithmetic Operators

1. Addition (+): Adds two values.

2. Subtraction (-): Subtracts second value from first.

3. Multiplication (*): Multiplies two values.

4. Division (/): Performs true division and returns a float.

5. Floor Division (//): Returns the integer part of division (rounds down).

6. Modulus (%): Gives the remainder of division.

7. Exponentiation (**): Raises the first number to the power of the second.

2. Logical Operators

Logical operators are used to combine multiple conditions. They return either True or False.

Types of Logical Operators

1. and: Returns True if all conditions are true.

2. or: Returns True if any one condition is true.

3. not: Reverses the logical state of its operand.

Key Points

- Arithmetic operators deal with numbers.

- Logical operators deal with conditions (True/False).

- Logical operators are mostly used in decision-making (if-else statements).

You might also like