Python Programming from First Principles: Learn to Code, Think Computationally, and Solve Real-World Problems
PDFEPUB
PYTHON BASICS

Python basics

A working installation lets us execute instructions; understanding those instructions begins with values. Numbers, text and names provide the material from which Python programs are built.

A Python program begins with values and instructions. Numbers and text represent information; variables give that information names. Operators combine values, while input and output connect the program with its user.

As a program grows, control flow determines which instructions run and when they repeat. Data structures keep related values together. Functions give reusable operations a name, and modules organise those definitions across files. These foundations prepare the way for classes and objects in the following part of the book.