boolean in Python

0 votes

I know that you can do:

checker = 1
if checker:
    #dostuff

But I enjoy seeing booleans in Java. For instance:

Boolean checker;
if (someDecision)
{
    checker = true;
}
if(checker)
{
    //some stuff
}

Is there such a thing as a Boolean in Python? I can't seem to find anything like it in the documentation.

Nov 2, 2018 in Python by findingbugs
• 3,260 points
787 views

1 answer to this question.

0 votes

True ... and False obviously.

checker = None # not necessary
if some_decision:
    checker = True
if checker:
    # some stuff
answered Nov 2, 2018 by Priyaj
• 58,020 points

Related Questions In Python

0 votes
0 answers

Boolean comparison in Python

I am trying to print false using ...READ MORE

Sep 17, 2018 in Python by ana1504.k
• 7,910 points
682 views
0 votes
1 answer
0 votes
1 answer

What is the syntax to compare boolean value in Python?

The opposite of dest in lower.keys() is dest not in ...READ MORE

answered Aug 21, 2019 in Python by Neel
• 3,020 points
664 views
+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,890 points
20,014 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,441 views
0 votes
1 answer
+2 votes
3 answers

How can I play an audio file in the background using Python?

down voteacceptedFor windows: you could use  winsound.SND_ASYNC to play them ...READ MORE

answered Apr 4, 2018 in Python by charlie_brown
• 7,720 points
13,549 views
+1 vote
1 answer

How to create plots using python matplotlib in IPython notebook?

I think you should try: I used %matplotlib inline in ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 58,020 points
1,582 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP