What does `=` mean in Python?
Assignment evaluates the expression on the right and associates its result with the name on the left. The `=` symbol assigns a value; it does not test mathematical equality.
Study 03 — Python Programming Fundamentals with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What does `=` mean in Python?
Assignment evaluates the expression on the right and associates its result with the name on the left. The `=` symbol assigns a value; it does not test mathematical equality.
Can a Python variable change type?
A variable’s current value determines its type; the name itself is not permanently fixed to one type. For example, `item` can refer first to `10` and later to the string `"ten"`.
What is multiple assignment?
`width, height = 8, 5` assigns 8 to `width` and 5 to `height`. Multiple assignment can also exchange values, as in `left, right = right, left`.
Why convert the result of `input()`?
`input()` returns text, so numeric input must be converted before arithmetic. Use `int()` for whole numbers or `float()` for numbers that may contain a fractional part.
What does an f-string do?
An f-string inserts expressions inside braces, such as `f"{name} worked in {year}."`. It produces formatted text using the current values of those expressions.
What do `//` and `%` return?
`7 // 2` gives `3` because `//` performs floor division, while `7 % 2` gives `1`, the remainder after division.
How do `=` and `==` differ?
`=` assigns a value to a name, whereas `==` compares two values and produces a Boolean result such as `True` or `False`.
How does an `if` chain choose a branch?
In an `if`/`elif`/`else` chain, conditions are tested in order and at most one branch runs. The `else` branch runs only when all preceding conditions are false.
Is `range()`'s endpoint included?
The endpoint passed to `range()` is excluded. Therefore, `range(1, 4)` produces `1`, `2`, and `3`.
What causes an infinite `while` loop?
A `while` loop can run forever if its condition never becomes false. The loop body must change relevant state so that termination eventually becomes possible.
How do `break` and `continue` differ?
`break` immediately leaves the nearest loop. `continue` skips the rest of the current iteration and begins the next iteration.
What is the difference between a parameter and an argument?
In `def square(number):`, `number` is a parameter. In `square(6)`, `6` is the argument supplied to that parameter when the function is called.
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
A 14-question quiz on trees, binary trees, traversals, recursive algorithms, and binary search trees. The questions progress from foundational concepts to applied reasoning about structure, complexity, and BST operations.
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
Learn how to choose, structure, document, and maintain software documentation for users, developers, integrators, and operators.
A structured guide to comparison-based sorting algorithms, their complexity, stability, memory use, and practical selection criteria.
Reviews how interrupts support event handling and multitasking, and how Linux system calls use the RISC-V `ecall` instruction and register conventions.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.
A quiz on operating-system system calls, including privileged-operation requests, process creation and execution with fork, exec, and waitpid, and signal handling.