Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What does and do
#1
Please consider the following Python expression where a and b have integer values.

a and b

I claim that value of this expression is 0, if a is 0. If a is non-zero then the value of this expression is b. Do I have this right?

I am also wondering why it would be defined this way. Any idea?
Reply


Messages In This Thread
What does and do - by rsherry8 - Apr-28-2021, 11:25 AM
RE: What does and do - by Yoriz - Apr-28-2021, 11:53 AM
RE: What does and do - by rsherry8 - Apr-28-2021, 11:59 AM
RE: What does and do - by Yoriz - Apr-28-2021, 12:33 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020