Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What is the purpose of an if statement?

View

What does the else block do?

View

How many elif blocks can be used in an if-else structure?

View

What is the result of if 0: print("True")?

View

Can an else block be omitted?

View

What happens if multiple conditions in an if-elif structure are true?

View

What will be the output of x = 5; print(x)?

View

What is the type of variable created with x = '10'?

View

What happens when you try to access a variable not defined in Python?

View

Which of the following cannot be used as a variable name?

View

What is the purpose of an if statement?

To create loops
To execute a block of code based on a condition
To define variables
To perform arithmetic

What does the else block do?

Executes if the condition is True
Executes if the condition is False
Skips the next iteration
Terminates the program

How many elif blocks can be used in an if-else structure?

Only one
Multiple
None
One for each if block

What is the result of if 0: print("True")?

True
False
Nothing
0

Can an else block be omitted?

Yes
No

What happens if multiple conditions in an if-elif structure are true?

All true blocks are executed
Only the first true block is executed
None are executed
It causes an error

What will be the output of x = 5; print(x)?

5
x
0
Error

What is the type of variable created with x = '10'?

int
float
str
bool

What happens when you try to access a variable not defined in Python?

Returns None
Throws a ValueError
Throws a NameError
Throws an ImportError

Which of the following cannot be used as a variable name?

yield
lambda
self
All of the above