liveBook · Manning

Python

As explained in Get Programming: Learn to code with Python

A general-purpose, interpreted programming language with dynamic typing and significant standard-library support.

Python is a general-purpose programming language for writing programs ranging from quick, simple tasks to applications and websites. A Python interpreter is the program that runs code written in Python. The language and the interpreter share the same name, but they do different jobs. section 3.1

To get started, set up a Python environment and write a small program. You can then practice making decisions, repeating tasks, and breaking larger tasks into smaller ones. Errors are part of that practice: try a change, run the program, and work out what happened. section 1.2 section 1.3

Give a value a name

In `score = 9`, `9` is an object and `score` is a name you can use to refer to it later. Naming a value saves you from repeatedly describing or recalculating it. Try choosing a name that makes its purpose clear. section 4.0

Names need a little care when they refer to objects you can change, such as lists and dictionaries. Assigning an existing object to another variable creates an alias, not a separate copy. Change that mutable object through one name, and the change is visible through its other names. If you need an independent object, make a copy. section 28.3

Keep practicing with short exercises before moving to larger programs. Packages written by other programmers can later help you make programs that respond to mouse or keyboard input, or read, analyze, and write structured data. section 1.3

How Get Programming: Learn to code with Python covers it

How deep it goes
Defines the interpreter and introduces objects and variables, then reaches aliasing and copying mutable objects.
Examples
Uses everyday object-naming analogies and dictionary exercises to make variable assignment and mutation concrete.
What it assumes
Starts without assuming programming experience and introduces the development environment before building programs.
What you can do after
Build it from scratch by writing Python programs with variables, decisions, repetition, and reusable operations.
How it connects
Connects Python to interpreters, objects, variables, testing, debugging, packages, and mutable data structures.

Also explained in

Compare how 26 books explain Python →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Get Programming: Learn to code with Python. The section links point to the parts of the book it draws on.