Somebody help me in Boolean logic under (not) seem hard to me please help | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 3

Somebody help me in Boolean logic under (not) seem hard to me please help

31st Dec 2017, 7:04 PM
@Rich_WMB
@Rich_WMB - avatar
6 Réponses
+ 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 ‚ėļ
31st Dec 2017, 7:36 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
"Not" simply mean invert. True is false: false is true.
31st Dec 2017, 7:08 PM
josh mizzi
josh mizzi - avatar
+ 1
what do you need help with
31st Dec 2017, 7:08 PM
death
death - avatar
+ 1
He said he didn't understand what "not" means
31st Dec 2017, 7:09 PM
josh mizzi
josh mizzi - avatar
+ 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
31st Dec 2017, 7:27 PM
death
death - avatar
- 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‚Äô))
31st Dec 2017, 9:56 PM
H Chiang