1

428views

Explain the arithmetic and logical operators in python.

**1 Answer**

1

428views

Explain the arithmetic and logical operators in python.

2

3views

written 2.5 years ago by |

**Arithmetic Operators in Python :-**

Operator | Name | Example |
---|---|---|

+ | Addition | a + b |

- | Subtraction | a - b |

* | Multiplication | a * b |

/ | Division | a / b |

% | Modulus | a % b |

** | Exponentiation | a ** b |

// | Floor Division | a // b |

**Logical Operators in Python :-**

Operator | Description | Example |
---|---|---|

and | Returns True if both statements are true | x < 5 and x < 10 |

or | Returns True if one of the statements is true | x < 5 or x < 4 |

not | Reverse the result, returns False if the result is true | not(x < 5 and x < 10) |

ADD COMMENT
EDIT

Please log in to add an answer.