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

Which of the following is the correct way to use an if statement in Python?

View

What keyword is used to execute code when an if condition is false?

View

Which control flow structure would you use to execute code repeatedly until a condition becomes false?

View

What does the elif keyword do in Python?

View

What will happen if no conditions are met in a series of if-elif statements?

View

In Python, can you nest if statements inside other if statements?

View

Which of the following control flow structures handles multiple conditions in Python?

View

What is the purpose of the break statement?

View

Which of the following is not a valid control flow keyword?

View

What is the purpose of an if statement?

To create a loop
To make decisions based on conditions
To define a function
To return a value from a function

Which of the following is the correct way to use an if statement in Python?

if x == 10:
if (x == 10)
if x = 10
if x != 10 then:

What keyword is used to execute code when an if condition is false?

elif
else
end
otherwise

Which control flow structure would you use to execute code repeatedly until a condition becomes false?

If statement
Function
Loop
Dictionary

What does the elif keyword do in Python?

Executes an alternate block of code if the first if condition is false
Terminates a loop
Ends the program
Breaks out of a function

What will happen if no conditions are met in a series of if-elif statements?

The program crashes
The last condition is executed by default
The program continues without executing any conditional block
The program raises an error

In Python, can you nest if statements inside other if statements?

Yes
No

Which of the following control flow structures handles multiple conditions in Python?

for loop
if-elif-else
while loop
Function definition

What is the purpose of the break statement?

To continue executing the next iteration of a loop
To stop the current iteration and exit the loop
To define the end of a function
To skip the current loop iteration

Which of the following is not a valid control flow keyword?

break
pass
return
skip