Boolean

Category: Variables

Last updated 5 months ago

Yuvi Saraw

Yuvi Saraw Asked 6 months ago

Can someone please give me a simple example of a Boolean variable.


Jeff Plumb

Jeff Plumb Answered 5 months ago

Hi Yuvi,

A boolean variable can hold the value True or False. Hence an example would be:

playing = True

Once you have created that you can use it in conditional statements

if playing:
    print("You are playing")

Notify me of updates
Add to Favourites
Back to Questions

No comments yet!


Become a free member to post a comment about this question.