KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Which of the following is the correct sequence to create multiple conditional statements?

  1. if else else
  2. if elif else
  3. if else elif
  4. if else if

Python Control Flow

1 Like

Answer

if elif else

Reason — In Python, when we need to check more than one condition, we use the if-elif-else statement. The if statement checks the first condition, the elif statement checks the next condition, and the else statement is executed when none of the conditions are true. Therefore, the correct sequence to create multiple conditional statements is if elif else.

Answered By

2 Likes


Related Questions