Explore our extensive collection of questions and answers to enhance your learning experience and prepare for exams effectively
The = operator assigns a value to a variable, e.g., x = 5.
print(__name__) outputs ‘__main__’ when the script is run directly.
Python 3.5 introduced type hints via the typing module.
venvScriptsactivate activates a virtual environment on Windows.
__name__ == ‘__main__’ checks if the script is run directly, not imported.
A tuple is immutable, meaning its elements cannot be changed after creation.
A docstring provides documentation for functions, classes, or modules.
python script.py runs a Python script from the command line.
REPL stands for Read-Eval-Print Loop, an interactive Python environment.
Python was first released in 1991 by Guido van Rossum.