CAS CS 111 Lecture Notes - Lecture 5: Boolean Expression

240 views14 pages
Verified Note

Document Summary

Flow of control = order in which statements are executed. By default, a program"s statements are executed sequentially, from top to bottom: conditional execution. To solve many types of problems, we need to change the standard flow of control. Conditional execution allows your code to decide whether to do something, based on some condition. Examples of calling this function from the shell: recall: conditional execution in scratch, simple decisions: if statements. Condition is an expression that is true or false. True block is one of more intended statements. Python provides a set of relational operators for making comparisons: boolean expressions. A condition has one of two values: true or false. They are literals from the bool data type. An expression that evaluates to true or false is known as a boolean expression: forming more complex conditions. Python provides logical operators for combining/modifying boolean expressions: a word about blocks. A new block begins whenever we increase the amount of indenting.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents