Backend development

Stage 1 · Lesson 2 of 10

Python syntax and collections

Your language and how HTTP works

Learn the Python you will write every day: variables, if statements, loops, functions and the four built-in . A list is an ordered group of items you can change. A tuple is a fixed group, like that should not change.

A dict maps keys to values, and looking up a key is fast (O(1) on average, meaning the time barely grows with size). A set keeps only unique items. A comprehension such as [u.email for u in users if u.active] builds a list in one line and replaces most hand-written loops. such as f"Hello {name}" format text.

Remember that indentation is part of the syntax. Also remember that 0, empty strings and empty lists all count as false in an if.

Common trapa default argument: def add(item, items=[]) shares one list across every call, so write items=None and create the list inside the function.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Practise

  • Your language track: small exercises with free mentor feedback on idiomatic code

Keep handy

  • Quick syntax lookups for your language when you forget how something is written

  • Read the HTTP overview, methods, headers and status code pages until they feel obvious

Also worth your time

Mark this stage as not done?