Tag view

#syntax

Cross-subject tag search for related interview cards.

Clear

Results update as you type. Press / to jump straight into search.

Tagged with syntax

7 cards

Python Medium Theory

Conditional statements, ternary expressions, and match-case basics

Python uses `if`/`elif`/`else` for general branching, a ternary expression for concise value selection, and `match-case` for structural pattern matching in newer versions.

  • Use ternary for small expressions only
  • match-case compares shapes and patterns
  • Readable branching beats clever branching

Conditional statements, ternary expressions, and match-case basics

Python Easy Theory

String formatting and f-strings

Python supports old `%` formatting, `str.format`, and f-strings, with f-strings usually being the clearest modern default.

  • f-strings embed expressions directly
  • format works well for reusable templates
  • % formatting still appears in older code

String formatting and f-strings

Python Easy Theory

What is a decorator?

A decorator wraps another callable to add behavior without changing the original function body.

  • Starts with a callable
  • Usually returns a wrapper
  • Common for logging, auth, caching

What is a decorator?