Help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help

Tell me what the 'and' operator looks like in Python

30th Jun 2022, 7:22 AM
Евгений Мартынов
Евгений Мартынов - avatar
3 Answers
+ 1
In python there are 'and' keyword and '&' bitwise operator. While 'and' is used to compare objects, '&' is used as the 'AND' binary operator: if 'a' and 'b': print('yes') #will print yes print(1&2) #will print 0.
30th Jun 2022, 7:31 AM
Ervis Meta
Ervis Meta - avatar
0
Thank you
30th Jun 2022, 7:36 AM
Евгений Мартынов
Евгений Мартынов - avatar
0
And operator print when both condition are true.. Suppose If (x and y ): Print("true") Its print true when both cond are true...
30th Jun 2022, 7:53 AM
Mihir Lalwani
Mihir Lalwani - avatar