What should you put instead of XXX to print out the module name?
What should you put instead of XXX to print out the module name?
To print out the module name in Python, you should use the special variable __name__. When a Python file is run directly, the __name__ variable is set to '__main__'. Therefore, to check if the module is being run directly, you compare __name__ to '__main__'. If they are not equal, it means the module is being imported elsewhere, and you print the module name using __name__. So the correct replacement for XXX is '__main__'.
not = but ==
They have capitalised the If and put a space between ! and =, so I think they mean if __name__ !="__main__"
C. __main__