Devnote

Web Development Blog Company, Services India

MySQL Error 121 Duplicate key on write - Practical Repair Strategy
MySQL Error 121 Duplicate key on write – Practical Repair Strategy
February 13, 2026
PHP cURL error 60: SSL certificate problem - Windows & Linux Fix
PHP cURL error 60: SSL certificate problem – Windows & Linux Fix
February 11, 2026
Fix localhost refused to connect After Installing XAMPP / WAMP
Fix “localhost refused to connect” After Installing XAMPP / WAMP
February 9, 2026
Composer Error Memory exhausted When Installing Packages - Real Fix
Composer Error: Memory exhausted When Installing Packages – Real Fix
February 6, 2026
MySQL 8 Error Unknown collation: utf8mb4_0900_ai_ci - Safe Migration Guide
MySQL 8 Error Unknown collation: utf8mb4_0900_ai_ci – Safe Migration Guide
February 4, 2026
Devnote

Type and hit Enter to search

  • Home
  • Laravel
    • Auth
    • Migration
    • DATATABLE
    • Yajra
  • wordpress
    • plugin
    • WPBakery
    • woocommerce
  • PHP
    • MYSQL
    • Ajax
  • Blog
  • Informational
    • About us
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
  • Contact US
Devnote
  • Home
  • Laravel
    • Auth
    • Migration
    • DATATABLE
    • Yajra
  • wordpress
    • plugin
    • WPBakery
    • woocommerce
  • PHP
    • MYSQL
    • Ajax
  • Blog
  • Informational
    • About us
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
  • Contact US
Python logical operators

Python logical operators

Image
Devnote team
November 11, 2020
One Min Read
734 Views
0 Comments

This tutorial is a Python logical operators. python Logical operators are used to comparing multiple relational expressions. We can use logical operators by using that we can combine more than one relational expression and according to return true or false.

Python buil-in 3 logical operators:

  1. And
  2. Or
  3. Not

And

And an operator is more than one relational expression and it will return true. if one of the expressions is false then it returns false.

Syntax

expression1 and expression2

Example

numbers = 105

if numbers > 100 and numbers < 150:
    print("Number is between 100 and 150")
print("Number is :",numbers)

Output:
Number is between 100 and 150
Number is : 105

Or

Or an operator is more than one relational expression and it returns true. if one of the expressions is true and the second false then it will return true.

Syntax

expression1 or expression2

Example

numbers = 105
if numbers == 100 or numbers == 105:
    print("Or operator success!")
print("Number is", numbers)
Output:

Or an operator success!
Number is 105

Not

not an operator is used to reverse the logical state of the expression.

Syntax

not expression1

Example

numbers = 150
if not numbers == 100:
    print("Not operator success!")
print("Numbers is",numbers)
Output:
Not operator success!
Numbers is 150

Categories:

Uncategorized

Other Articles

Command line arguments
Previous

Command line arguments in Python

Python loop statements
Next

Python loop control statements

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

How to Create a Custom ACF Option Module in WordPress

How to Create a Custom ACF Option Module in WordPress

April 28, 2025
Laravel: Remove All Spaces from a String with Examples

Laravel: Remove All Spaces from a String with Examples

January 27, 2025
Top 5 Free Online IDEs for Effortless Coding

Top 5 Free Online IDEs for Effortless Coding

October 16, 2024
Efficiently Searching an Element in an Array

Efficiently Searching an Element in an Array

October 10, 2024
Devnote

Devnote provides a collection of tutorials about PHP, Laravel, WordPress, Django, MySQL, Bootstrap, Jquery, Ajax, APIs, CRUD operations, etc.

Devnote © , All Rights Reserved.

Page Links

  • Home
  • About us
  • Blog
  • Contact US
  • Site map

Category

  • PHP
  • Laravel
  • wordpress
  • HTML
  • jQuery

Follow Us

Facebook Instagram Twitter Youtube Linkedin Pinterest
Morbi, Gujarat, India - 363641
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT
Advertisement