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
For int and float operands, / performs true division and returns a float, while // floors the quotient 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 takes values from any iterable, including a sequence, dictionary, set, or generator.
Work through questions with a tutor and get help with the steps you find difficult.
Get help with this topic