Python Programming: An Introduction To Computer Science
Python Programming: An Introduction
To Computer Science
Chapter 8 Booleans
Coming up: Computing with
1
Booleans
Computing with Booleans
?!if and while both use Boolean expressions.
?! Boolean expressions evaluate to True or False.
?! So far we've used Boolean expressions to compare two values, e.g. (while x >= 0)
Boolean Operators
?! The Boolean operators and and or are used to combine two Boolean expressions and produce a Boolean result.
?! and ?! or
Expressions versus Statements
?! In the last slide we used the term "expression".
?! The difference between an expression and a statement is:
?!Expressions are something (they evaluate to a value)
?! e.g. x*7+(y**3) , t==True or v1 != v2
?!Statements do something
?! print "hello" ?! x = x * 7
Statement or Expression
?! x = 9 ?! 45 % 78 == 0 ?! myFunction(`potato') ?! x, y = 5, 6 ?! print "%20s" %(`potato') ?! "%20s" %(`potato')
Statement Expression Statement Statement Statement Expression
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- python programming an introduction to computer science
- python activity 5 boolean expressions and selection
- concepts in this slide real life examples for making
- python operators cheat sheet writeblocked
- boolean expressions and if
- operators and expressions
- c o n d i t i o n a l s s e c t i o n 2 1 b o o l e a
- boolean expressions python rela6onal operators
Related searches
- an introduction to marketing pdf
- introduction to computer systems pdf
- an introduction to moral philosophy
- introduction to computer studies pdf
- introduction to computer science
- introduction to computer packages pdf
- introduction to computer pdf notes
- introduction to computer science free
- introduction to computer science class
- an introduction to an essay
- introduction to computer science course
- introduction to computer science online