Section 3.3 Assessment: Expressions
Subgoals for writing expressions:.
- Craft name of variable
- Determine operators, function calls, or method calls that will produce the value of variable
-
Decide order of operands and operators
- Operators and operands must be compatible
- Decompose as necessary
Exercises Exercises
- Yes
- No
- True
- False
- This code is invalid
2.
Q2: Is the following code valid?
alpha = 3
beta = 7
gamma = -3.5
delta = '5'
epsilon = 'numbers'
gamma += beta
3.
4.
5.
Q5: What is the value of
theta
after the following code is executed?alpha = 3
beta = 7
gamma = -3.5
delta = '5'
epsilon = 'numbers'
theta = gamma < beta + delta
You have attempted 1 of 6 activities on this page.