+ 9

python boolean logic

in python we use "and" term for && operater, when we use "!" operator for not operater. i'm confuse please help me...

25th Feb 2018, 12:19 PM
Shivani Goyal
8 ответов
+ 18
Logical AND: and Logical OR: or Logical NOT: not Bitwise AND: & Bitwise OR: | Bitwise XOR: ^ Bitwise Complement: ~
25th Feb 2018, 1:14 PM
LunarCoffee
LunarCoffee - avatar
25th Feb 2018, 12:37 PM
Вадим Сухотин (Vadim Sukhotin)
Вадим Сухотин (Vadim Sukhotin) - avatar
+ 1
In Python, Boolean logic is written using words instead of symbols. For example, and is used instead of &&, or replaces ||, and not is used instead of !. This makes the code more readable and closer to plain English. For instance, if you want to check if both conditions are true, you would write if a and b:. To negate a condition, you simply use not, like if not a:. This approach is part of Python’s philosophy of writing clean and understandable code.
10th Apr 2025, 3:56 PM
Max Wolfrum
Max Wolfrum - avatar
0
you can easily understood see the code https://code.sololearn.com/cvF6cpPyN56o/?ref=app
25th Feb 2018, 2:23 PM
Moniprasad
Moniprasad - avatar
0
because we have to program huge lines So makers decided make easy sometimes...... & some times !
17th Jul 2018, 2:36 PM
Aadesh Kumar
Aadesh Kumar - avatar
0
Like Vadim already said, you couold use the "not" for determining it in your issue. Yoshi
3rd Jul 2020, 10:28 AM
Yoshi
Yoshi - avatar
0
because we have to program huge lines So makers decided make easy sometimes...... & some times !
1st Sep 2021, 11:33 PM
DivyanshuYash
DivyanshuYash - avatar
0
There are shortcut symbols for every Logical operator in Boolean, by using these shortcuts our code will be seen fantastic and also less words will be used in our codes. And there will be no difference if we use AND or Symbol & And same for the rest of Boolean Logical operators
24th Sep 2022, 8:34 AM
Yousef Yousefzai