what are and and or operators in Python

0 votes
I am confused with "and" and "or" operators. when are they used?
Apr 18, 2018 in Python by ana1504.k
• 7,910 points
856 views

1 answer to this question.

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 18, 2018 by Johnathon
• 9,090 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 May 21, 2019 in Python by Mohammad
• 3,230 points
2,078 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 aryya
• 7,460 points
1,745 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, 2019 in Python by Shashank
• 1,370 points
1,020 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
• 58,020 points
3,762 views
0 votes
0 answers

what is a bitwise operator in python?

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

Apr 8, 2019 in Python by Waseem
• 4,540 points
487 views
0 votes
0 answers

what is the logical AND operator in python?

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

Apr 12, 2019 in Python by Waseem
• 4,540 points
512 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,441 views
+1 vote
7 answers
0 votes
3 answers

What is python? Where it is used?

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

answered Mar 18, 2019 in Python by rajesh kumar
1,094 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP