0
What is the point of the line my_boulion=True? I can't see a point to it.
I can also make it my_boulion ="dog" or my_boulion = 7
5 ответов
+ 3
When you do
my_boolean = True
You assign the variable"my_boolean" as a Boolean type, and set its value to True
if you do
my_boolean = "dog"
it will be string type
my_boolean = 7
will be int type
+ 1
you may want to initialize the state of that variable. that way you have a known starting point. the asumption is that later you would test it with the == operator
0
Can you specify the context?
0
the control structures module on the very first page.
0
Note that
my_boolean = "True"
will set the variable as a string type because of the inverted commas