Skip to playerSkip to main contentSkip to footer
  • 5/18/2025
To assign a boolean value in Python, use the keywords True or False. These are the only two boolean values in Python and are case-sensitive. You can assign them directly to a variable or as the result of a boolean expression.
Transcript
00:00In the first lecture, we had to play with Billy and Billy.
00:03We had to play with the end condition,
00:06so that Billy and the dog should be together,
00:11so that the dog should be.
00:12Right?
00:13Good.
00:15Now, we have to note that
00:18I use the values of direct boolean values.
00:22What if I write,
00:25and here I write,
00:30what do you think?
00:35Basically, I do not like this,
00:39that cat,
00:42and dog,
00:44because this variable is the value of the value.
00:48So what do you think?
00:51This is the value of the value.
00:56If you give it to the condition,
00:58it will be a boolean.
01:03So if you give it to true value,
01:06it will be a false return.
01:08If I execute it,
01:10what do you think?
01:11Let's see.
01:13Run.
01:14And mouse run away.
01:16Interesting enough.
01:18This value has been true return,
01:20and this value has been true return.
01:22How is it possible?
01:24How is it possible?
01:25How is it possible?
01:26That meow true is.
01:27Boolean.
01:28And wolf true is.
01:30How is it possible?
01:31One rule of thumb is,
01:34that you call a simple bool function,
01:37and then check the value for what it returns.
01:40Let's say,
01:41I give the bool to this,
01:42and the bool to this,
01:43and the bool to this,
01:44and the wolf to this.
01:45See we will see,
01:46what bool is.
01:47Why?
01:48Because condition is,
01:50at the end,
01:52bool function of the bool form,
01:53the value is called at the end.
01:55The value is called.
01:57The value is above.
01:58The bool function of the bool function,
02:00the bool function of the bool function.
02:02The return as well.
02:03Before the bool function of the bool function,
02:06the bool function is called at the end.
02:09So that doesn't belong.
02:10Now,
02:11I will see.
02:12I mean, I will execute that both are true.
02:14Isn't it interesting?
02:16Very interesting.
02:18If meow and woof true are,
02:21then all which things are true?
02:23Interesting, right?
02:25If meow and woof are boolean in true return,
02:28then it could be true exactly.
02:31Then, false, which will be true?
02:33Very good question.
02:35False, which is very limited.
02:37True, which is unlimited.
02:39Basically, I am going to add a list.
02:41These values, none, false, zero,
02:45zero point zero, zero j, decimal of zero,
02:48fraction zero one,
02:50empty list, dictionary, empty tuple,
02:52empty string.
02:54Okay?
02:55Empty byte, empty set.
02:58These values are false.
03:00I am not sure.
03:02Let's do it.
03:04Empty string is false.
03:06I am not sure.
03:08meow and woof,
03:30I will do this.
03:31I will do this.
03:32Cat replace.
03:33Okay.
03:34And here we go.
03:35Cat.
03:36Cat.
03:37Cat.
03:38Now we execute.
03:39And Kaboom Shaka Allah.
03:42Mouse.
03:43Why?
03:44Empty string.
03:45False return.
03:46Isn't it cool?
03:47It's very cool.
03:49If you give empty list.
03:53And in the other place, you give empty dictionary.
03:58Right?
03:59It's exactly your suit.
04:01You are saying the same thing.
04:03Mouse eat the cheese.
04:05Right?
04:06So basically, this is how I know.
04:09If you think about it.
04:10I know about Google.
04:13Isn't it interesting?
04:15Very interesting.
04:16You don't have to memorize anything.
04:20Don't memorize anything.
04:22If you are programming.
04:24Please stop right now.
04:27Right now.
04:28Right now.
04:29Stop.
04:30Don't memorize anything.
04:31Everything is available.
04:32Stack Overflow.
04:33Stack Overflow.
04:34Stack Overflow.
04:35Stack Overflow.
04:36Stack Overflow.
04:37Stack Overflow.
04:38Stack Overflow.
04:39By the way, when you are looking at it, Stack Overflow.
04:41Stack Overflow.
04:42Stack Overflow.
04:43Stack Overflow.
04:44Stack Overflow.
04:45Stack Overflow.
04:46That is a result.
04:4790% of the time.
04:48Right?
04:49Okay.
04:50Stack Overflow.
04:51So it's caught.
04:53Cockごit open.
04:54frog boom

Recommended