About This Test
This test assesses your mastery of Python's control flow structures and conditional logic.
The test measures your ability to write and understand if statements, loops, and flow control logic. You'll demonstrate knowledge of boolean operations, loop iterations, break and continue statements, and nested control structures.
Questions present code samples where you trace execution paths, predict output, or identify logic errors. You'll encounter problems involving conditionals, for loops, while loops, and complex nested structures.
Use your results to identify gaps in your logical reasoning skills and flow control understanding. Practice tracing code mentally and refactor inefficient control structures to strengthen your programming foundation.
What This Test Covers
Variables and Data Types
Integers, floats, strings, and booleans, plus Python's dynamic typing and how the interpreter infers a variable's type at runtime rather than at compile time.
Control Flow
if, elif, and else branches, for and while loops, range, break and continue, and how Python uses indentation instead of braces to define blocks.
Functions and Scope
Defining functions with def, positional and keyword arguments, default values, return values, and how local, enclosing, and global scope resolve names.
Built-in Data Structures
Lists, dictionaries, sets, and tuples, their mutability differences, common methods, indexing and slicing, and choosing the right structure for a task.