Lesson 1.1
Variables and Dynamic Typing
A Python variable is a name bound to an object, and the type belongs to the object rather than to the name. Rebinding a name to a different type is legal.
Variables, types, operators, and control flow. Python hides type declarations, which makes the language friendly to start and makes type errors appear later than they would elsewhere.
Lesson 1.1
A Python variable is a name bound to an object, and the type belongs to the object rather than to the name. Rebinding a name to a different type is legal.
Lesson 1.2
The two division operators differ: one always produces a float, the other floors toward negative infinity. Mixing int and float promotes to float.
Lesson 1.3
Strings are immutable sequences. Formatted string literals interpolate expressions directly and are the clearest way to build output.
Lesson 1.4
Indentation defines blocks, so structure is enforced by layout. A for loop iterates over a sequence directly rather than over indices.
Work through questions with a tutor and get help with the steps you find difficult.
Get help with this topic