Category: Variables

Last updated 1 month ago

Yuvi Saraw

Yuvi Saraw Asked 1 month ago

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

Jeff Plumb

Jeff Plumb Answered 1 month 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.