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:
Explain what programming is at a high level
Describe how Python fits into the broader computing landscape
Distinguish conceptual programming ideas from Python-specific syntax
Identify where to find environment and Jupyter setup guidance
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 |
20 |
|
A built-in function used to display output. |
21 |
F-string |
A formatted string literal that can include Python expressions inside braces. |
22 |
|
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 |
|
A built-in function that returns the code point of a single character, such as |
25 |
|
A built-in function that returns the character for a code point, such as |
26 |
Comment |
A note that starts with |
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 |
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 |
|
A special value that represents the absence of a value; a function without a |
33 |
Module |
A single Python file ( |
34 |
Package |
A directory of related modules that forms a larger namespace and is often installed with |