Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 4: Making choices - Coggle Diagram
Chapter 4: Making choices
Boolean Values
True
False
Can use If statements to complete actions based on boolean
Comparison Operators
<: Less Than
<=: Less than or equal
: Greater than
=: Greater than or equal
==: Equal
!=: Not equal
Combining conditional expressions
Can be combined to produce relatively complex conditions
(Number1 < 6) and (Number2 >7)
Dealing with logical errors
Trace the values and variables
Using print helps
Critical values are values that lie outside the tolerances or program
Conditional code
If something is less than or greater than
If 1 > 2 total number = 1 else total number = 2
For statement
It's a control flow statement (if else for statements)
Can use a list which is ['']
Can use a sequences ('')
Casting is converting a variable value from one type to another such as int() or float()