CS110: Spring 2025

Intro to Computer Programming with Python

CS110: Spring 2025

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

Week 2: Thu, Apr 10

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). 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 Intro pre-recorded 6:57
Video 2 Demo: Working with the Command Line pre-recorded 5:51
Video 3 Installing Python pre-recorded 6:11
Video 4 Demo: 3 Ways to Execute Python pre-recorded 7:07
Video 5 Lists & Tuples pre-recorded 13:14

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. 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