python - flow_control - Part I
KSATs: K0107, K0713, K0715, K0735, S0032, S0033, S0081, S0082
Measurement: Written, Performance
Lecture Time: 15 Minutes
Demo/Performance Time: 1 Hour
Instructional Methods: Informal Lecture & Demonstration/Performance
Multiple Instructor Requirements: 1:8 for Labs
Classification: UNCLASSIFIED
Lesson Objectives:
-
LO 1 Comprehend if, elif, else statements in Python (Proficiency Level: B)
- MSB 1.1 Describe if, elif, else syntax (Proficiency Level: B)
- MSB 1.2 Given Python Code, predict the behavior of code involving if, elif, else syntax. (Proficiency Level: B)
-
LO 2 Comprehend While loops in Python (Proficiency Level: B)
- MSB 2.1 Describe While loop syntax (Proficiency Level: B)
- MSB 2.2 Describe using the while loop to repeat code execution. (Proficiency Level: B)
- MSB 2.3 Given Python Code, predict the outcome of a while loop. (Proficiency Level: B)
-
LO 3 Comprehend For loops in Python (Proficiency Level: B)
- MSB 3.1 Describe For loop syntax (Proficiency Level: B)
- MSB 3.2 Describe using the For loop to iterate through different data type elements. (Proficiency Level: B)
- MSB 3.3 Given Python Code, predict the outcome of a For loop. (Proficiency Level: B)
-
LO 4 Comprehend Python operators (Proficiency Level: B)
- MSB 4.1 Describe the purpose of membership operators (Proficiency Level: B)
- MSB 4.2 Describe the purpose of identity operators (Proficiency Level: B)
- MSB 4.3 Describe the purpose of boolean operators (Proficiency Level: B)
- MSB 4.4 Describe the purpose of assignment operators (Proficiency Level: B)
-
LO 5 Given a scenario, select the appropriate relational operator for the solution. (Proficiency Level: C)
-
LO 6 Given a code snippet containing operators, predict the outcome of the code. (Proficiency Level: C)
-
LO 7 Comprehend the purpose of the Break statement (Proficiency Level: B)
-
LO 8 Comprehend the purpose of the Continue statement (Proficiency Level: B)
-
LO 9 Given a code snippet, predict the behavior of a loop that contains a break/continue statement. (Proficiency Level: B)
Performance Objectives (Proficiency Level: 3c)
-
Conditions: Given access to (references, tools, etc.):
- Access to specified remote virtual environment
- Student Guide and Lab Guide
- Student Notes
-
Performance/Behavior Tasks:
- Control the execution of a program with conditional if, elif, else statements.
- Use a while loop to repeat code execution a specified number of times
- Iterate through Python object elements with a For loop
- Utilize assignment operators as part of a Python code solution.
- Utilize boolean operators as part of a Python code solution.
- Utilize membership operators as part of a Python code solution.
- Utilize identity operators as part of a Python code solution.
- Utilize break or continue statements to control code behavior in loops.
-
Standard(s)
- Criteria: Demonstration: Correctable to 100% in class
- Evaluation: Students will have 4 hours to complete the timed evaluation consisting of both cognitive and performance components.
- Minimum passing score is 80%
References
- https://docs.python.org/3/library/io.html
- https://docs.python.org/3/library/operator.html
- https://docs.python.org/3/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops
- https://realpython.com/python-conditional-statements/
- https://wiki.python.org/moin/ForLoop
- https://wiki.python.org/moin/WhileLoop
- https://www.tutorialspoint.com/python/python_basic_operators.htm
- https://www.tutorialspoint.com/python3/python_files_io.htm
- https://www.w3schools.com/python/python_for_loops.asp
- https://www.w3schools.com/python/python_while_loops.asp