Skip to main content
CS1 Python Subgoals
ξ
Contents
ξ’Ά
Search Book
close
Search Results:
No results.
ξ
Prev
ξ
Up
Next
ξ
ο
Scratch ActiveCode
ο
Profile
Course Home
Assignments
Practice
Peer Instruction (Instructor)
Peer Instruction (Student)
Change Course
Instructor's Page
Progress Page
Edit Profile
Change Password
Log Out
1
Demographic Survey
1.1
Demographic Survey
2
Evaluate Expressions
2.1
Declaration and Initialization
2.1.1
2.1.2
SG1: Decide order of operations
2.1.3
SG2: Determine operator behavior based on operands
2.1.4
SG3: Solve arithmetic, expression, or operation
2.2
Evaluate Expressions-WE1-P1
2.2.1
2.2.2
Expressions-WE1-P1
2.2.2
Exercises
2.3
Evaluate Expressions-WE1-P2
2.3.1
2.3.2
Evaluate Expressions-WE1-P2
2.3.2
Exercises
2.4
Basic Knowledge
2.4.1
2.4.2
SG1: Decide order of operations
2.4.3
SG2: Determine operator behavior based on operands
2.4.4
SG3: Solve arithmetic, expression, or operation
2.4.5
Questions to check understanding
2.5
Evaluate Expressions-WE2-P1
2.5.1
2.5.2
Evaluate Expressions-WE2-P1
2.5.2
Exercises
2.6
Evaluate Expressions-WE2-P2
2.6.1
2.6.2
Evaluate Expressions-WE2-P2
2.6.2
Exercises
2.7
Basic Operation Precedence
2.7.1
2.7.2
SG1: Decide order of operations
2.7.3
SG2: Determine operator behavior based on operands
2.7.4
SG3: Solve arithmetic, expression, or operation
2.7.5
Questions to check understanding
2.8
Evaluate Expressions-WE3-P1
2.8.1
2.8.2
Evaluate Expressions-WE3-P1
2.8.2
Exercises
2.9
Evaluate Expressions-WE3-P2
2.9.1
2.9.2
Evaluate Expressions-WE3-P2
2.9.2
Exercises
2.10
Operation Precedence
2.10.1
2.10.2
SG1: Decide order of operations
2.10.3
SG2: Determine operator behavior based on operands
2.10.4
SG3: Solve arithmetic, expression, or operation
2.10.5
Questions to check understanding
2.11
Evaluate Expressions-WE4-P1
2.11.1
2.11.2
Expressions-WE4-P1
2.11.2
Exercises
2.12
Evaluate Expressions-WE4-P2
2.12.1
2.12.2
Expressions-WE4-P2
2.12.2
Exercises
2.13
Compound Operators
2.13.1
2.13.2
SG1: Decide order of operations
2.13.3
SG2: Determine operator behavior based on operands
2.13.4
SG3: Solve arithmetic, expression, or operation
2.13.5
Questions to check understanding
2.14
Evaluate Expressions-WE5-P1
2.14.1
2.14.2
Expressions-WE5-P1
2.14.2
Exercises
2.15
Evaluate Expressions-WE5-P2
2.15.1
2.15.2
Expressions-WE5-P2
2.15.2
Exercises
2.16
Assign Booleans
2.16.1
2.16.2
SG1: Decide order of operations
2.16.3
SG2: Determine operator behavior based on operands
2.16.4
SG3: Solve arithmetic, expression, or operation
2.16.5
Questions to check understanding
2.17
Evaluate Expressions-WE8-P1
2.17.1
2.17.2
Expressions-WE8-P1
2.17.2
Exercises
2.18
Boolean Relations
2.18.1
2.18.2
SG1: Decide order of operations
2.18.3
SG2: Determine operator behavior based on operands
2.18.4
SG3: Solve arithmetic, expression, or operation
2.19
Evaluate Expressions-WE9-P1
2.19.1
2.19.2
Expressions-WE9-P1
2.19.2
Exercises
2.20
Boolean Truthiness
2.20.1
2.20.2
SG1: Decide order of operations
2.20.3
SG2: Determine operator behavior based on operands
2.20.4
SG3: Solve arithmetic, expression, or operation
2.20.5
Questions to check understanding
2.21
Evaluate Expressions-WE10-P1
2.21.1
2.21.2
Expressions-WE10-P1
2.21.2
Exercises
3
Write Expression
3.1
Convert Temperature
3.1.1
3.1.2
1. Craft name of variable
3.1.3
2. Determine operators, function calls, or method calls that will produce the value of variable
3.1.4
3. Decide order of operands and operators
3.2
WriteExpression-WE1-P1
3.2.1
WriteExpression-WE1-P1
3.2.1
Exercises
3.3
Assessment: Expressions
3.3
Exercises
4
Evaluate Conditionals
4.1
If Statements
4.1.1
4.1.2
1. Diagram which statements go together by indentation
4.1.3
2. For conditional, determine whether expression is true
4.1.4
3. If true, follow true branch; If false, follow next elif/else branch or exit conditional if no else branch
4.1.5
4. Repeat 2 and 3 as necessary
4.2
Evaluate Conditionals-WE1-P1
4.2.1
Conditionals-WE1-P1
4.2.1
Exercises
4.3
If Else Statements
4.3.1
4.3.2
1. Diagram which statements go together by indentation
4.3.3
2. For conditional, determine whether expression is true
4.3.4
3. If true, follow true branch; If false, follow next elif/else branch or exit conditional if no else branch
4.3.5
4. Repeat 2 and 3 as necessary
4.4
Evaluate Conditionals-WE2-P1
4.4.1
Conditionals-WE2-P1
4.4.1
Exercises
4.5
Apply Truthiness
4.5.1
4.5.2
1. Diagram which statements go together by indentation
4.5.3
2. For conditional, determine whether expression is true
4.5.4
3. If true, follow true branch; If false, follow next elif/else branch or exit conditional if no else branch
4.5.5
2. For conditional, determine whether expression is true
4.5.6
3. If true, follow true branch; If false, follow next elif/else branch or exit conditional if no else branch
4.5.7
2. For conditional, determine whether expression is true
4.5.8
3. If true, follow true branch; If false, follow next elif/else branch or exit conditional if no else branch
4.5.9
Answer
4.6
Evaluate Conditionals-WE3-P1
4.6.1
Conditionals-WE3-P1
4.6.1
Exercises
4.7
If Statements
4.7.1
4.7.2
1. Diagram which statements go together by indentation
4.7.3
2. For conditional, determine whether expression is true
4.7.4
3. If true, follow true branch; If false, follow next elif/else branch or exit conditional if no else branch
4.7.5
SG2: For if statement, determine whether expression is true
4.7.6
SG2.2: If false, follow next elif/else branch or exit conditional if no else branch
5
Write Conditional
5.1
Write Conditional
5.1.1
5.1.2
1. Define how many mutually exclusive paths are needed
5.1.3
2. Order paths from most restrictive to least restrictive
5.1.4
3. Write conditional statement with Boolean expression
5.1.5
4. Follow with true path including action in indentation
5.1.6
5. Repeat 3 and 4 until all paths are included
5.1.7
6. (Optional) Follow with else path including action in indentation
5.2
WriteConditional-WE2-P1
5.2.1
WrCond-WE2-P1
5.2.1
Exercises
5.3
Assessment: Conditionals
5.3
Exercises
6
Evaluate Loops
6.1
While Counter
6.1.1
6.1.2
Determine loop components
6.1.3
Trace the loop, writing updated values for every iteration or until you identify the pattern
6.2
Evaluate Loops-WE1-P1
6.2.1
Evaluate Loops-WE1-P1
6.2.1
Exercises
6.3
For Loop Range
6.3.1
6.3.2
Determine loop components
6.3.3
Trace the loop, writing updated values for every iteration or until you identify the pattern
6.4
Evaluate Loops-WE2-P1
6.4.1
Evaluate Loops-WE2-P1
6.4.1
Exercises
6.5
Complex Conditional
6.5.1
6.5.2
Determine loop components
6.5.3
Trace the loop, writing updated values for every iteration or until you identify the pattern
6.6
Evaluate Conditionals-WE3-P1
6.6.1
Evaluate Loops-WE3-P1
6.6.1
Exercises
6.7
While Loops Sentinel
6.7.1
6.7.2
Determine loop components
6.7.3
Trace the loop, writing updated values for every iteration or until you identify the pattern
6.8
Evaluate Loops-WE4-P1
6.8.1
Evaluate Loops-WE4-P1
6.8.1
Exercises
6.9
For Loops with Lists
6.9.1
6.9.2
Determine loop components
6.9.3
Trace the loop, writing updated values for every iteration or until you identify the pattern
6.10
Evaluate Loops-WE5-P1
6.10.1
Evaluate Loops-WE5-P1
6.10.1
Exercises
6.11
Nested Loops
6.11.1
6.11.2
Determine loop components
6.11.3
SG2: Trace the loop, writing updated values for every iteration or until you identify the pattern
6.11.4
SG1: Determine loop components
6.11.5
SG2: Trace the loop, writing updated values for every iteration or until you identify the pattern
6.12
Evaluate Loops-WE6-P1
6.12.1
Evaluate Loops-WE6-P1
6.12.1
Exercises
7
Write Loop
7.1
Write Loops
7.1.1
7.1.2
1. Determine purpose of loop to pick loop structure (for, while)
7.1.3
2. Define variables before loop that have dependencies within the loop
7.1.4
3. Based on loop structure
7.1.5
4. Write loop body
7.2
WriteLoops-WE5-P1
7.2.1
WriteLoops-WE1-P1
7.2.1
Exercises
7.3
Assessment: Writing Loops
7.3
Exercises
8
Use Library
8.1
Use Math
8.1.1
8.1.2
1. Import module or function (if needed)
8.1.3
2. Determine whether parameters are appropriate for function
8.1.4
3. Determine what the function will return (i.e., data type), print, and/or change state of arguments and where it will be stored (nowhere, somewhere)
8.1.5
4. Evaluate expression as necessary
8.2
Use Library-WE1-P1
8.2.1
Use Library-WE1-P1
8.2.1
Exercises
8.3
Assessment: APIs
8.3
Exercises
9
Evaluate Functions
9.1
Variables Call
9.1.1
9.1.2
1. Create stack frame for global variables
9.1.3
2. Ensure function is defined before function call before beginning body of function
9.1.4
3. Determine parameter values based on positional arguments, keyword arguments, and default values to initialize local variables
9.1.5
4. Use stack frame for function to trace local variables
9.1.6
5. At return to call site, pass values back to call site
9.1.7
6. Delete stack frame with local variables after return to call site
9.1.8
Answer
9.2
Evaluate Functions-WE1-P1
9.2
Exercises
9.3
Evaluate Functions
9.3.1
Simple Call
9.3.2
Keyword Arguments
9.3.3
Nested Calls
9.3.4
Calls within Calls
9.4
Evaluate Functions-WE2-P1
9.4
Exercises
10
Write Function
10.1
Average Numbers
10.1.1
10.1.2
1. Define and initialize global variables
10.1.3
2. Write function header with function name and parameters (must include () even without parameters)
10.1.4
3. Write function body
10.1.5
4. Determine what to return, if anything, to call site
10.1.6
5. Call function with appropriate arguments
10.2
WriteFunction-WE1-P1
10.2
Exercises
10.3
Assessment: Functions
10.3
Exercises
11
Write Lists
11.1
Worked Example: Writing Lists - Storing Multiplication Table
11.1.1
11.1.2
SG1: Instantiating a list variable
11.1.3
SG5: Traversing a list
11.1.4
SG4: Changing the value of a list element
11.1.5
11.1.6
Practice Pages
11.2
Writing-Lists-WE1-P1
11.2.1
11.3
Worked Example: Writing Lists - Shifting List Values
11.3.1
11.3.2
SG1: Instantiating a list variable
11.3.3
SG4: Adding or changing value of a list element
11.3.4
11.3.5
Practice Pages
11.4
Writing-Lists-WE2-P1
11.4.1
11.4.1
Exercises
π
Section
2.5
Evaluate Expressions-WE2-P1
Subgoals for evaluating an assignment statement.
π
Decide order of operations
Decompose as necessary
Determine operator behavior based on operands
Operator and operands must be compatible
Solve arithmetic, expression, or operation
Decompose as necessary
π
Subsection
2.5.1
π
For all given problems below indicate if the code is valid or invalid. Each problem is independent of the others (e.g. Question 2 does not depend on Question 1, only the βGivenβ code).
π
Subsection
2.5.2
Evaluate Expressions-WE2-P1
π
Given
alpha
=
2
beta
=
1
delta
=
'3.0'
theta
=
-
1.3
π
Exercises
Exercises
π
1
.
π
Q11:
valid
invalid
π
2
.
π
Q12:
valid
invalid
π
3
.
π
Q13:
valid
invalid
π
4
.
π
Q14:
valid
invalid
You have attempted
1
of
6
activities on this page.