Python Junior
What are negative indexes in Python?
Select the correct answer
Negative indexes in Python allow counting from the end of a list.
Negative indexes in Python are used for error handling.
Negative indexes in Python start the count from zero.
Negative indexes in Python are only for string manipulation.
What is a docstring in Python, and why is it useful?
Select the correct answer
A docstring is a type of exception in Python.
A docstring is a variable name in Python.
A docstring is a comment used to document code in Python.
A docstring is a string literal used for documentation in Python.
Explain the pass statement in Python.
Select the correct answer
The pass statement raises an exception.
The pass statement pauses the execution of code.
The pass statement exits the current loop.
The pass statement is a no-op placeholder in Python.
How do you handle exceptions in Python?
Select the correct answer
Exceptions in Python are handled using try and catch blocks.
Exceptions in Python are handled using validate and except blocks.
Exceptions in Python are handled using error and catch blocks.
Exceptions in Python are handled using try and except blocks.
Is Python pass by reference or pass by value?
Select the correct answer
Python uses a mix of pass by reference and pass by value.
Python is pass by value.
Python is pass by reference.
Python is pass by object reference.
Explain mutable and immutable data types in Python?
Select the correct answer
Mutable types cannot be changed after creation, while immutable types can.
Only strings in Python are immutable.
Mutable types can be changed after creation, while immutable types cannot.
Both mutable and immutable types cannot be changed after creation.
What is PEP 8, and why is it important?
Select the correct answer
PEP 8 is a security standard in Python.
PEP 8 is the style guide for writing Python code.
PEP 8 is a performance enhancement proposal.
PEP 8 is a Python error prevention tool.
Is Python statically or dynamically typed?
Select the correct answer
Python is weakly typed.
Python is statically typed.
Python is dynamically typed.
Python uses type inference.
Is Python a compiled language or an interpreted language?
Select the correct answer
Python is an interpreted language.
Python is a compiled language.
Python is a scripting language only.
Python is a low-level programming language.