0

Python . Can someone please explain how my_boolean can help us in a program, because I think is useless ?

Pls respond No seen

29th Apr 2019, 11:09 AM
JohnSia2005
11 Antworten
+ 1
my_boolean is a variable name you can use any name that you like, in my example i use six and less_than_ten as a variable.
29th Apr 2019, 11:56 AM
Taste
Taste - avatar
+ 1
yes, my_boolean is just an example
29th Apr 2019, 11:58 AM
Taste
Taste - avatar
0
what did you mean by my_boolean ? and stop reposting your question, maybe there are just few people online rn. it can be considered as spam.
29th Apr 2019, 11:11 AM
Taste
Taste - avatar
0
Taste I will stop we someone answer. I mean : my_boolean, how this code can help us in a program
29th Apr 2019, 11:25 AM
JohnSia2005
0
tell me on how you normally use it. maybe you'll need to be more clear on your question. because i never heard of my_boolean in python other than user defined variable. i also try to google it with no result.
29th Apr 2019, 11:33 AM
Taste
Taste - avatar
0
Taste I want to know if there is a reason to use boolean (my_boolean) in a program
29th Apr 2019, 11:40 AM
JohnSia2005
0
oooh a boolean, it mostlly used in if or loop. the main purpose of having my_boolean as its own variable is for readability. you can also use the expression by itself without storing them in a variabe. six = 6 less_than_ten = six < 10 if less_than_ten: print("ok") this one is also fine if six < 10: print("ok")
29th Apr 2019, 11:46 AM
Taste
Taste - avatar
0
Taste Where is my_boolean?
29th Apr 2019, 11:55 AM
JohnSia2005
0
Or less_than_ten is the boolean Which means that my_boolean is just an exemple and a booleans can be even paul_is_fat?
29th Apr 2019, 11:57 AM
JohnSia2005
0
Taste Aaaaaaaa Thank you so much. No one said that before.
29th Apr 2019, 12:02 PM
JohnSia2005