Question

What is the purpose of the "if __name__ == '__main__':" statement in a Python script?

A It defines the main function of the script.
B It checks if the script is being run as the main program.
C It specifies the version of Python required to run the script.
D It imports the required modules for the script.
Practice Next

Relevant for Exams:

Hey! Ask a query