Session 2 Preparation — Videos, Reading and Quizzes
The preparation time you will need for Sessions 2 and 3 is longer than what you will need for most later sessions.
Start this work as soon as you can after class; plan to do a few of the items. Take a break and come back to later items.
That will be much more fun and better for your learning than doing it all in a row.
A student assistant will be in the F-217 CSSE lab in Mouench Hall Thursday evening 7-9 PM,
in case you need help with any of this prep work, or if you have issues with Eclipse/PyDev/Subclipse/etc.
Quizzes:
Do this Quiz on Session 2
as you watch the videos and do the reading (as listed below).
This document is a Microsoft Word document;
here is the same Quiz on Session 2 (pdf) as a PDF.
You can either:
- Print it (two-sided is greenest) and fill it in by hand, or
- Download it, fill it in electronically, and then print it (two-sided is greenest).
In either case, bring paper copy of the completed quiz to your Session 2 class.
Videos and Reading (online and textbook):
All of the following are required except the items labeled Optional are, well, optional
(i.e., things that may be interesting but do not directly pertain to your success in this course).
- Introduction to Session 2
-
Video (embedded in a web page) [3:14 minutes]
-
Video (as an mp4 that you can download if you want: 7.41 MB)
- Getting started in Python via the PyDev Console — Objects, Types, Variables, Assignment and more
-
Now work through some of the the follow-up PyDev Console exercises (up
through #20 on Page 8) in:
Important:
- If you began this exercise in Session 1, simply continue from where you left off.
- There is nothing to save or turn in; just do this exercise per its instructions and LEARN from it!
- If you have lots of time and the desire to continue beyond #20,
go for it. But don't feel obligated to do so. We will
deal with that material later.
- You are likely to have questions from this exercise:
simply bring your questions to Session 2.
- Variables
- Textbook reading: Section 2.1 — Variables (7 pages).
- See description and advice for what to focus on at the bottom of this page.
- Input-Compute-Output Programs
-
Video (embedded in a web page) [8:36 minutes]
-
Video (as an mp4 that you can download if you want: 18.1 MB)
Additionally, read this
Annotated Input-Compute-Output Program
that the video walks you through.
- Do NOT expect to understand EVERYTHING in it in full detail yet!
- But do BRING your QUESTIONS about it to class.
- Calling Functions
-
Video (embedded in a web page) [3:22 minutes]
-
Video (as an mp4 that you can download if you want: 5.64 MB)
Additionally, here is a
handout on Calling Functions
that you might find useful as a reference or quick read.
- Arithmetic
- Textbook reading: Section 2.2 — Arithmetic (8 pages).
- See description and advice for what to focus on at the bottom of this page.
- Coding to a Specification
-
Video (embedded in a web page) [4:23 minutes]
-
Video (as an mp4 that you can download if you want: 7.20 MB)
- First do it by hand!
- Textbook reading: Section 2.3 — First Do it By Hand (8 pages).
- This is a simple but critical section.
- Preview of a Session 2 Exercise — An
Optional Live Coding Example
- This video is
Optional (but read this note):
This long (20 minute) video shows a professor doing the very same exercise that YOU will do at the beginning of your in-class Session 2.
- As such, watching it may be a great way to walk into class confident of success.
- But if you run short of time, you can also watch it later, or just ask us questions when you are doing in-class Session 2.
- After all, that is the POINT of doing the (challenging) exercises IN-CLASS — we are there to answer your questions RIGHT AWAY.
- So, use your own judgment for how much or little time you want to spend watching this video.
The video is:
-
Video (embedded in a web page) [19:39 minutes]
-
Video (as an mp4 that you can download if you want: 74.3 MB)
- Examples from Session 1
If time permits, browse the modules (files) from your Session 1 project
(checked out form Subversion using Subclipse). For each example:
- RUN the module.
- Look at its code and try to see what each statement seems to do.
- Do NOT expect to understand all the code in all the examples!
- In particular, the chaos_loop and graphics examples feature several ideas that we will be discussing in Sessions 3 and 4 (but not yet!).
- The hello_world and hello_goodbye and input_compute_output examples should make some sense to you after you have done the above videos/reading/quiz.
You will investigate the ideas from those examples in class during Session 2.
Reading from your texbook (Python for Everyone):
The following reading reinforces and extends material you saw in the videos and online reading.
- If you already "get" a topic covered in this reading assignment,
just skim it quickly to make sure there is nothing you are missing.
- Pay special attention to the ideas indicated below.
- Do NOT try to memorize all the details, as you will practice (and learn) these ideas in your forthcoming in-class exercises.
- Bring your questions to class.
Required:
- Section 2.1 — Variables (7 pages). Focus your attention on:
- What is a variable? How do you assign a value to a variable?
- What is a type? What is the difference between a float and an int?
- What is a string? What is the difference between the following two statements?
x = 4
x = "4"
- What is a comment? Why are they important, and to whom?
- Common Error 2.1 on page 36: Using Undefined Variables
- Programming Tip 2.1 on page 36: Choose Descriptive Variable Names
- Section 2.2 — Arithmetic (8 pages). Focus your attention on:
- Using expressions that involve addition, subtraction, multiplication, and division.
- The
** operator for exponentiation.
- The modulus (remainder) and floor division operators. See Table 3 on page 39.
- How to call a function, sending it arguments, and capture the returned value in a variable. See the Syntax 2.2 diagram on page 40.
- Section 2.3 — Problem Solving: First Do It By Hand.
This is a simple but critical section.
Your textbook is: