Skip Navigation

Python Primer

OVERVIEW AND GETTING STARTED

About This Primer

This primer comprises a sequence of instructional videos and Python notebooks covering:

  • How to install Python and several integrated development environments
  • An introductory guide to the Python language. 

The table of contents below provides links to open the notebooks in Google Colab (from which they can also be downloaded), and to open the videos in the TAMIDS YouTube channel

This primer was created by Matt Hielsberg with support from Texas A&M Institute of Data Science and the Texas A&M University Department of Mathematics.

Quick Start Guide for Learning Python Without Any Software Installation

  • Obtain a Google account if you don’t already have one; this is needed to run Google Colab. When opening each notebook, you may need to agree to run the content when prompted by Colab.
  • Skip down below to the Python Language Guide and start at Chapter 4

Learning Objectives For This Python Primer

  • Learn where to find tutorials, documentation on Python as well as community developed packages.
  • Use comments and learn how to incorporate them into the help system.
  • Write and evaluate expressions using variable names.
  • Use basic data structures including strings, lists, tuples, sets, and dictionaries, among others.
  • Understand and use various control flow mechanisms, including looping, functions and exceptions.
  • Write functions, understand return values and argument lists, including positional and keyword arguments.
  • Understand binding and copies, as well as interning/small integer caching.
  • Learn about name resolution, blocks, scope and name spaces.
  • Find and use modules and packages.
  • Learn about objects, classes and inheritance, including multiple inheritance.

Python Systems and Installation Guide

Chapter 1: Background and Installation

SectionTopicNotebook/ColabVideos
1.1Background and InstallationOpenVideo (3:32)

Chapter 2: Getting Started with Python Interpreter

SectionTopicNotebook/ColabVideos
2.1InterpreterOpenVideo (5:25)
2.2ScriptsOpenVideo (10:08)
2.3GuidelinesOpenVideo (4:21)

Chapter 3: Getting Started with Jupyter

SectionTopicNotebook/ColabVideos
3.1ColabOpenN/A
3.2JupyterOpenN/A

Python Language Guide

Chapter 4: Introduction

SectionTopicNotebook/ColabVideos
4.1Help, Docstrings, & CommentsOpenVideo (7:06)
4.2CalculatorOpenVideo 1 (4:23)
Video 2 (3:15)
4.3Comparison, Logical and Bitwise OperatorsOpenVideo (13:30)
4.4VariablesOpenVideo (6:09)
4.5StringsOpenVideo 1 (8:37)
Video 2 (3:01)
Video 3 (5:46)
Video 4 (4:08)
4.6ListsOpenVideo 1 (1:21)
Video 2 (2:41)
Video 3 (4:43)
Video 4 (5:43)

Chapter 5: Control Flow

SectionTopicNotebook/ColabVideos
5.1Blocks, IndentionOpenVideo 1 (3:36)
Video 2 (6:19)
Video 3 (10:07)
Video 4 (7:45)
5.2Looping Techniques and ConditionsOpenVideo 1 (6:45)
Video 2 (4:14)
5.3FunctionsOpenVideo 1 (2:37)
Video 2 (3:39)
Video 3 (12:08)
Video 4 (3:41)
5.4ExceptionsOpenVideo 1 (4:17)
Video 2 (11:25)
Video 3 (2:14)
Video 4 (5:20)
5.5 Short-Circuit EvaluationOpenVideo (2:47)

Chapter 6: Data Structures

SectionTopicNotebook/ColabVideos
6.1Lists RevisitedOpenVideo 1 (8:24)
Video 2 (17:00)
6.2Stacks and QueuesOpenVideo (3:57)
6.3TuplesOpenVideo (5:43)
6.4SetsOpenVideo (8:32)
6.5DictionariesOpenVideo (9:35)

Chapter 7: Names

SectionTopicNotebook/ColabVideos
7.1ObjectsOpenVideo (7:41)
7.2Assignments CopiesOpenVideo (8:27)
7.3Small Integer CachingOpenVideo (5:43)
7.4Name ResolutionOpenVideo (14:10)
7.5Modules PackagesOpenVideo (9:37)

Chapter 8: Classes

SectionTopicNotebook/ColabVideos
8.1Classes – InheritanceOpenVideo 1 (10:39);
Video 2 (8:15)