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.

 

Learning Materials

Explaining the weekly format for the next few weeks

 

Getting Started with IPO Problems

 

Textbook Readings

 

The Use of AI in computer program

Paired Programming Activity

Please complete the following Paired Programming activity with your assigned partner for the week.

 

Additional Explanations

Think of the following a little bit like podcasts. I will add videos here as I get questions from students or when I decide that I need to say something more beyond what is in the book. These won't "drop" on a particular day like the podcasts did in FCCS but will get added as the need arises. I would suggest you watch this space to see if new stuff has shown up. And if you have questions and feel there is a video that needs to go here PLEASE email me and let me know.

 

Additional Practice

The following problems are entirely optional but are provided here to give you some additional practice if you are interested. You should complete these on your own rather than with a partner.

 

 

Code Walkthroughs

The following are videos and code solutions for the programs discussed in the Paired Programming Activity and Individual Program Activity. You SHOULD NOT view these until you have either solved the activities yourself - and you want to see how I would do it - or you have tried at least two different times and still are stumped. Don't jump to reading the "correct answer" too quickly. I think it is a GOOD thing to struggle with a problem for a day or two. We improve when we meet and overcome resistance. Learning comes from practice. You need to TRY before jumping to the solutions.

 

Graded Practice

The following programs are formally graded as part of the Unit 2 "Problem Set." You should work on these only as an individual. While working on these problems you may refer to your notes, your textbook, any programs you wrote, and even my videos. However, you should limit your discussion of these programs with classmates. It is acceptable to discuss how you solved a problem in the grand scheme of things, but you should never show your code to a classmate either as the person who is struggling or as the person who is helping a struggling classmate. You can talk ideas, but not specific solutions.