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 elif statement mean?

View

How is the else block executed?

View

Which of the following expressions is correct?

View

Which of the following operators is used to combine multiple conditions?

View

What will the expression not True or False return?

View

Can an if statement be used without an else block?

View

What is the output of if []:?

View

What is a ternary conditional expression?

View

How do you exit a program using a conditional statement?

View

What is the purpose of an if statement?

To repeat code multiple times
To decide whether to execute code based on a condition
To exit a loop
To define functions

What does the elif statement mean?

It is short for "else if"
It creates a loop
It defines a new function
It ends the program

How is the else block executed?

Only if the if condition is false
Only if the if condition is true
If all elif conditions are false
Both A and C

Which of the following expressions is correct?

if x = 10:
if x == 10:
if (x := 10):
if x is 10:

Which of the following operators is used to combine multiple conditions?

+
or
==
=

What will the expression not True or False return?

True
False
Error
None

Can an if statement be used without an else block?

Yes
No
Only inside loops
Only for numeric conditions

What is the output of if []:?

True
False
Error
None

What is a ternary conditional expression?

An if statement with three conditions
A shorthand for if-else
A loop with a stopping condition
A function call

How do you exit a program using a conditional statement?

quit()
break
exit()
Both A and C