CS110: Fall 2020

Intro to Computer Programming with Python

CS110: Fall 2020

Schedule > 4. Intro to Lists & Tuples; Intro to the Command Line

Week 2: Wed, Sep 23

In this lesson, we will review several different concepts: the command line, running python files, and an intro to more complex data structures (lists and tuples).

Note: The slides/files references in the videos have changed slightly

Some of the slides / file references have changed from last quarter, but the content is the same.

During lecture, we will be going through several different examples of how you might want to use a list.

Today's Activities

For today, please do the following:

1. Download the Exercise Files

Exercise Files

2. Review the Slides

  1. The Command Line, Running Python, Lists & Tuples
  2. Supplementary Slides for Live Lecture

3. Watch the Lecture Video(s)

Link Title Type Duration
Video 1 Demo: Working with the Command Line pre-recorded 12:40
Video 2 Demo: 3 Ways to Execute Python pre-recorded 05:59
Video 3 Lists & Tuples pre-recorded 10:16
Video 4 Practice with the command line, lists, and tuples lecture 47:41

4. Review / Study the Supplemental Materials

Note: these readings / videos are suggested for additional context / examples, but not required.

  1. Severance Ch9: Lists.
    readingvideo
  2. Severance Ch10: Tuples.
    readingvideo

5. Take the Quiz

Note: The quiz is to help you test your own understanding of the concepts. It is not graded, and is designed to help you to see what you already know and what you should review / ask about.
https://canvas.northwestern.edu/courses/120087/quizzes/122964

5. Review the command line Cheatsheet

For your convenience, we have made you a little cheatsheet to help you get familiar with the command line. Django Girls is a good resource. Note: you will not be tested on this or anything, but navigating the command line can be useful.

  DOS (Windows) Shell (Mac / Linux)
What directory am I in? > cd $ pwd
Change directories > cd $ cd
List files & directories > dir
> tree # lists subdirectories
$ ls
$ ls -l
Navigate to parent directory > cd .. $ cd ..
Navigate into child directory > cd cs110 $ cd cs110
Navigate into descendant directory > cd lectures\lecture_03 $ cd lectures/lecture_03
Navigate to sibling directory > cd ..\lecture_02 $ cd ../lecture_02
Navigate to ancestor directory > cd ..\..\ $ cd ../../
Navigate to home directory   $ cd
Command history > doskey /HISTORY $ history

Other optional commands you may find useful…

  DOS (Windows) Shell (Mac / Linux)
Create a new file > echo . > my_file.txt $ echo . > my_file.txt
$ touch my_file.txt
Append to a file > echo "some text" >> my_file.txt $ echo "some text" > my_file.txt
Save history to a file > doskey /HISTORY > my_history.txt $ history > my_history.txt
Move a file > move my_history.txt Documents/. $ mv my_history.txt Documents/.
Make a folder > mkdir my_folder $ mkdir my_folder
Delete a file > del my_history.txt $ rm my_history.txt
Delete a folder > rmdir my_folder $ rm -r my_folder