what are "and" and "or" operators in Python?

0 votes
I am confused with "and" and "or" operators. when are they used?
Apr 17, 2018 in Python by ana1504.k
• 6,110 points
17 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

AND - True if both the operands are true

OR - True if either of the operands are true

Consider the example below:

a = 58        # 111010

b = 13        # 1101

c = a & b     

print ( c )   # 8 = 1000

c = a | b      

print ( c )   # 63 = 111111
answered Apr 17, 2018 by Johnathon
• 9,050 points

Related Questions In Python

0 votes
1 answer

What are the naming conventions for variables and data types in python?

There are certain rules that we have ...READ MORE

answered 5 days ago in Python by Mohammad
• 1,400 points
11 views
0 votes
1 answer

Can someone explain the behaviour of increment and decrement operators in python

down voteaccepted ++ is not an operator. It is ...READ MORE

answered May 15, 2018 in Python by ariaholic
• 7,320 points
201 views
0 votes
2 answers

What are the types of dictionary in python?

There are 4 types of dictionary Empty Integer Mixed Dictionary with ...READ MORE

answered Feb 14 in Python by Shashank
• 1,350 points
35 views
0 votes
1 answer

Behaviour of increment and decrement operators in Python

When you want to increment or decrement, ...READ MORE

answered Jul 26, 2018 in Python by Priyaj
• 56,120 points
345 views
0 votes
0 answers

what is a bitwise operator in python?

can you show some operations using bitwise ...READ MORE

Apr 8 in Python by Waseem
• 2,070 points
10 views
0 votes
0 answers

what is the logical AND operator in python?

how do i use it in a ...READ MORE

Apr 12 in Python by Waseem
• 2,070 points
17 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
24 views
0 votes
2 answers

What do you mean by python scripting? What is a script and a module in python?

A scripting language is a programming language ...READ MORE

answered Mar 14 in Python by rajesh kumar
1,715 views
0 votes
3 answers

What is python? Where it is used?

 Python is develop by Guido Van Rossum ...READ MORE

answered Mar 18 in Python by rajesh kumar
41 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.