+ 3
What is boolean ?
I'm unable to understand the boolean,comparison ,operators and logics . suggest a way I can learn it
3 ответов
+ 3
Booleans are variables which can store only two values, True or False, it's useful for keeping track of things with a Yes/No answer.
For example, a player might have a boolean called can_jump to keep track of wether the player can jumo or not.
+ 3
Many built-in python operators return booleans as well, for example, > < >= <= ==
5 > 6 will return the boolean value False.
5 < 6 will return the boolean value True.
You can play around and see for yourself by doing print(10 == 10)
0
Booleans are conditions,they are used for comparing if that is true and false
The boolean is divided in False and True
True = 1
False = 0