Start learning →
Home › Olympiad (Class 10) › Computer Science › Booleans and Decisions › A learner writes an if statement with nothing in…

A learner writes an if statement with nothing in its body. Python will produce:

AA blank
BAn error
CA warning
DA comment
Answer & Solution
Correct answer: B. An error
1. The body must contain at least one statement. 2. An empty body is not allowed. 3. So Python produces an error. _Source: OpenStax Introduction to Python Programming, Chapter 4._
Practise this question with Quill — Olympiad (Class 10) →
Related questions