Python QA Basics
Python QA Basics
- Mapping: dict
- Boolean: bool
if condition1:
# code block
elif condition2:
# code block
else:
# code block
Syntax:
A dictionary is used when you want to associate keys with values and need fast lookups based on
custom keys.
- You need to store data with a unique identifier (like a name, ID).
- Errors: Serious problems that a program should not try to catch (e.g., syntax errors).
- Exceptions: Issues that can be caught and handled during runtime (e.g., ZeroDivisionError,
FileNotFoundError).
Errors are usually unrecoverable, while exceptions can be managed using try-except blocks.