Week 7
Working with IPO Problems
Weekly Summary
This week we will be looking at how we take the various mathematical expressions, variable assignment statements, and print statements that we learned about last week, and putting them together in small algorithms/programs (often referred to as "scripts" in the Python community).
Recall from our prior Scratch Unit that we defined algorithms and programs as:
One of the easiest types of algorithms to look at when we are just starting with Python is the concept of IPO Problems. IPO stands for:
- Input
- Process
- Output
As the name implies, these are basic problems that
- asks the human user for some input
- performs some processing on that input to calculate a result
- displays or outputs that result back to the human user
They tend to be relatively trivial and "simple" problems. But they are a great place for us to get started understanding how individual python statements/expressions can be put together to solve a task (an "algorithm" or "program").
Learning Outcomes
By the end of the week students should be able to:
- Reading Code
- Given a sequence of code using input statements, mathematical expressions, and print statements (IPO problem), determine the results of executing the code.
- Given a problem statement and several segments of code, identify which segment will solve the problem statement.
- Writing Code
- Given an IPO problem statement, write the python code that will solve the problem.
- Debugging Code
- Given a problem statement and a non-working program that attempts to solve the problem, identify where the code is incorrect and explain how to fix it.