Week 5
Transitioning to Python
Weekly Summary
In the first couple of weeks of this course you learned about the fundamental concepts, vocabulary, and structure of programming using a graphical programming language - Scratch. For the remainder of the semester we will be applying those same ideas to a text-based programming language - Python.
This week you will complete some activities to help with that transition.
Scratch is a language centered on visual graphics (sprites) and the movement of those sprites. While you can do similar activities in Python, it is more complicated. Instead, most programmers use Python to manipulate data. As we make this transition, we need to start by considering the the building block operators in Python that allow us to perform basic mathematical operations and store results in appropriate variables.
Recall from our prior Scratch Unit that we defined variables as:

Learning Outcomes
Most weeks I will tell you the learning outcomes for that one week. But weeks 5 and 6 are combined so we make the transition a little more slowly. By the end of week 6, students should be able to:
- Given the name for a variable, indicate whether it is a legal name in python (does it follow the rules of syntax).
- Given one or more mathematical expressions using the python mathematical operators, indicate the result.
- Describe the function of the three Python division operators.
- Explain differences between integer and floating-point data.
- Given one or more statements that set the value of a variable, indicate the data type of the variable.
- Given one or more statements, indicate the value(s) in one or more variables upon completion of the statements.
- Given a print statement, determine the output.
Learning Materials
Explaining this section
Each week I will ask you to complete several learning activities. These will typically consist of a combination of lesson videos, textbook readings, and hands on lesson activities. The order in which these are presented will vary from week to week. In most cases I strongly encourage you to complete them in the order presented in this section. But if you have some experience with this topic you may elect to shuffle them around and even skip certain sections. Just remember - you are responsible for this material and how it connects with the previously listed Learning Outcomes.
Preparing your Computer
The first things we need to do are to get your computer ready for the rest of the semester.
Complete a PRIMM activity
In a perfect world I would have you complete the following activity with 2 or 3 of your peers. But that's very difficult to coordinate in an online setting. So instead I ask you to complete this on your own but provide you the activity as it would be done as a PRIMM activity (we will study this technique in more detail next spring).
At this point in our course you have read a lot of Scratch code. Believe it or not, you probably have learned enough to actually read and understand some simple Python code. In this activity I will ask you to consider a Python program and answer some questions about this without even studing a single line of Python.
In my classroom, we would have several opportunities to talk about what you were doing during the PRIMM. Online, that gets lost. But we will get to a discussion on this in the lessons below.
- LESSON - Considering the PRIMM [Go ahead and skip to 13:30. The stuff before that is a discussion with my undergraduates about grades.]
Our Lessons - Getting Started with Python
- LESSON - Python is an interpreted language
- LESSON - Using several Python IDEs
- This video is from a previous offering of the class. One of the scenes mentions a tool called Repl.it and another mentions a Community of Practice event on the previous Saturday. Neither of these are elements of this course this fall. Don't panic if you catch these and think you missed something.
Complete a POGIL Activity
In a perfect world I would have you complete the following activity with 2 or 3 of your peers. But that's very difficult to coordinate in an online setting. So instead I ask you to complete this on your own but provide you the activity as it would be done as a POGIL activity (we will study this technique in more detail next spring).
- The structure of Python (POGIL Activity #1)
In my classroom, we would have several opportunities to talk about what you were doing in the POGIL. Online, that gets lost. But let's try to explain it all with the following videos.
- LESSON - Discussing Model 1 of the POGIL
- LESSON - Discussing Model 2 of the POGIL
- LESSON - Discussing Model 3 of the POGIL