Programming with Python

⌘K
  1. Home
  2. Docs
  3. Programming with Python
  4. Variables, Expression and...
  5. Operators and Types of Op...
  6. Logical Operators

Logical Operators

Logical Operators are used to combine conditional statements

Example

a=5
b=10
print("a<5 and b <20", a<5 and b<20)
print("a<5 or b <20",a<5 or b<20)
print("not(a<5 and b<20)",not(a<5 and b<20))

Output

('a<5 and b <20', False)
('a<5 or b <20', True)
('not(a<5 and b<20)', True)

Loading

Views: 1

How can we help?

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments