+ 3
Somebody help me in Boolean logic under (not) seem hard to me please help
6 Respuestas
+ 18
!true = false !!false=true
!!!false=true !!!false = false
//when we use && , then all expression must be true for returning true as final answer
//when or , then even if any one expression returns true , then final answer will return true else false
//example ::: (true && false) =false ,
(true or false) =true
//for even number of !'s , its the boolean value itself bcz all !'s get neutralised
//for odd number of !'s , its the reverse of boolean value
//hope it helps ☺
+ 3
"Not" simply mean invert. True is false: false is true.
+ 1
what do you need help with
+ 1
He said he didn't understand what "not" means
+ 1
so you would use not for when you need it to be swapped so if you use 1=2 it would be false but if you use not 1=2 then it would be true
- 1
@Richard Wambogo
Sometimes not is much simpler to write:
For example if you want to execute a statement if a character is anything but ‘a’ or ‘z’. How would you write that?
If (x==‘b’)or(x==‘c’)or...(x==‘y’)
Or you can write
If not ((x==‘a’)or(x==‘z’))
This is the same as:
If (x!=‘a’) and(x!=‘z’)
Or if for example you had 2 conditions x can be anything but ‘a’ and y can be anything but ‘z’.
Isn’t the following simpler:
If not ((x==‘a’)and(y==‘z’))