Boolean comparison in Python

0 votes

I am trying to print false using the following code but why does it not work?

smaller={}
 for( dest in a[neigbour].keys())

    if(dest in smaller.keys() == False):
        print 'false'
    }
Sep 17, 2018 in Python by ana1504.k
• 7,910 points
676 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

+7 votes
8 answers

Difference for string comparison in Python: 'is' vs. ==

If we use "==" means both variables ...READ MORE

answered Sep 3, 2018 in Python by Parul Raheja
2,437 views
0 votes
1 answer

boolean in Python

True ... and False obviously. checker = None # not necessary if ...READ MORE

answered Nov 2, 2018 in Python by Priyaj
• 58,020 points
781 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
661 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,007 views
+2 votes
2 answers

How can I create a new file in Python?

You can try the below code which ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,440 points
1,304 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,434 views
0 votes
1 answer
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