- 1
Value of Boolean
Can I set "False" for "my_boolean"? I tried but it did not change anything.
6 Answers
+ 2
my_boolean=False
if my_boolean:
print("boolean is True")
#this won't be printed
if not my_boolean:
print("boolean is False")
#this will be printed
+ 1
You may need to show your code.
+ 1
you should check your code you can do what you are trying..
0
give more details or show the code, maybe others can solve your problem
0
Hi
0
You can make any variable a Boolean variable, you just need to assign "True" or "False" as their value(without inverted commas).
Make sure that what you are writing is "False" and not "false"
Sample program with output:
>>> my_boolean = False
>>> if 3 > 4 :
>>> print (my_boolean)
False