Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (happykiddo):

Using Python:: Simplify the attached Boolean expressions. Please explain reasoning behind answers.

OpenStudy (happykiddo):

OpenStudy (rsmith6559):

A and B can be simplified with an idiom that C (which is the language that Python is written in) uses. False is defined as 0, NULL, nil, C doesn't have a boolean type so integers are used. True is defined as not false, which in binary would be 1, but for numbers it means anything non-zero is true. C could use a complex conditional, testing both conditions and using a logical operator (and, or) in one line. b doesn't need to be declared first. D I don't know a simpler way to do that. These all would benefit from the ternary operator, but Python doesn't have that.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!