Registry Synced

Week 1: Basics and Expressions

218 words
1 min read
Course: Jan 2026 - Python Focus: Types, arithmetic, strings, and the first trap layer of Python expressions.

1. Core idea

Week 1 is about reading expressions exactly as Python does, not as we wish they worked.

What to remember

  • int, float, str, and bool are the base types.
  • input() always returns a string.
  • / gives a float, even if the result looks whole.
  • // is floor division, not normal division.
  • Strings are sequences, so indexing and slicing work on them.

2. Common traps

  • 5 / 2 is 2.5, not 2.
  • "5" + 2 is invalid, because string and integer are different types.
  • and / or return one of the operands, not always True or False.
  • s[2] works only if s is a sequence.

3. Speedrun pattern

When you see a Week 1 question, ask:
  1. What type is each operand?
  2. Does the operator return a value or a type?
  3. Is this expression valid before evaluating its result?

4. Micro revision

  • Type check: type(x)
  • Cast: int(...), float(...), str(...)
  • Sequence access: s[i], s[a:b:c]

Assignment anchor

Document Outline
Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.