1

Which statement is used to define a block of code that runs only when the program is executed directly, not when imported?

Correct Answer: if __name__ == '__main__':

Make the most of this question

This page focuses on one Python MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.

Python MCQs MCQ: Which statement is used to define a block of code that runs only when the program is executed directly, not when imported? | Extra Education