O'Reilly logo

Learning Processing by Daniel Shiffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Conditionals

 

“That language is an instrument of human reason, and not merely a medium for the expression of thought, is a truth generally admitted.”

 
 --George Boole
 

“The way I feel about music is that there is no right and wrong. Only true and false.”

 
 --Fiona Apple

In this chapter:

  • Boolean expressions.

  • Conditional statements: How a program produces different results based on varying circumstances.

  • If, Else If, Else.

Boolean Expressions

What’s your favorite kind of test? Essay format? Multiple choice? In the world of computer programming, we only take one kind of test: a boolean test—true or false. A boolean expression (named for mathematician George Boole) is an expression that evaluates to either true or false. Let’s look at some common ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required