Introduction

1. Introduction#

This chapter gives you a high-level view of what programming is, how Python fits into the broader computing landscape, and which ideas you will rely on throughout the book.

  • Programming as a way to express steps and decisions

  • Python as a readable, practical language

  • Jupyter as a place to experiment with code

  • Basic syntax as the notation for programming ideas

  • Built-in functions as ready-to-use tools

Python is a practical first language because it lets you focus on problem solving without fighting the syntax too early. Its readability, standard library, and ecosystem also make it useful for automation, scripting, data analysis, and software development. This chapter has two sections: programming concepts first, then basic Python syntax.

Chapter Video

This introduction walks through installing Python and getting ready to run Python programs.

Python Tutorial for Beginners 1: Install and Setup for Mac and Windows (15:28) by Corey Schafer

Hosted on YouTube; property of its original creator, embedded here for educational reference only.

Learning Objectives

By the end of this chapter, you will be able to:

  1. Explain what programming is at a high level

  2. Describe how Python fits into the broader computing landscape

  3. Distinguish conceptual programming ideas from Python-specific syntax

  4. Identify where to find environment and Jupyter setup guidance

  5. Use basic built-in functions in simple Python code

Chapter Flow

Glossary

#

Term

Explanation

1

Program

A set of instructions written for a computer to execute.

2

Algorithm

A finite, ordered set of unambiguous steps that turns input into output.

3

Programming language

A formal notation for writing instructions that a computer can interpret or compile.

4

Natural language

A human language, such as English, that allows ambiguity and depends on context.

5

Formal language

A precisely defined language with strict syntax and meaning.

6

Abstraction

A simplified view that hides lower-level details so you can focus on the idea that matters.

7

Interpreted language

A language commonly run by executing source code through an interpreter.

8

Compiled language

A language commonly translated into another form before the program runs.

9

Programming construct

A basic building block used to express computation, such as a statement or expression.

10

Expression

A piece of code that produces a value.

11

Statement

A complete instruction that Python can execute.

12

Number system

A way to represent numbers using a base and a set of digits.

13

Binary

A base-2 number system that uses only 0 and 1.

14

Hexadecimal

A base-16 number system often used as a compact way to write binary values.

15

Character encoding

A mapping between characters and numeric codes.

16

Syntax

The formal rules for writing valid statements in a programming language.

17

Indentation

Leading whitespace that Python uses to show block structure.

18

Block

A group of statements that belong together under a control structure or definition.

19

Built-in function

A function available in Python without an import, such as print, input, len, or round.

20

print

A built-in function used to display output.

21

F-string

A formatted string literal that can include Python expressions inside braces.

22

input

A built-in function that reads text typed by the user.

23

Code point

The integer that represents a character in Unicode; for ASCII characters it equals the ASCII code.

24

ord

A built-in function that returns the code point of a single character, such as ord("A") returning 65.

25

chr

A built-in function that returns the character for a code point, such as chr(65) returning "A".

26

Comment

A note that starts with # and is ignored by the Python interpreter.

27

Docstring

A string literal written as the first statement of a module, function, or class to document what it does.

28

Keyword

A reserved word, such as if, for, or class, that has special meaning in Python and cannot be used as a variable name.

29

Soft keyword

A word that acts like a keyword only in certain Python contexts but can still be used as a name elsewhere.

30

Argument

A value passed into a function call inside the parentheses.

31

Return value

The value a function call produces, which you can store in a variable or use in an expression.

32

None

A special value that represents the absence of a value; a function without a return statement returns None.

33

Module

A single Python file (.py) containing code such as functions, classes, and variables that you can import.

34

Package

A directory of related modules that forms a larger namespace and is often installed with pip.

Lecture Slides

Chapter 1 Slides