Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
Python main file with class 1

Python main file with class

April 17, 2022 by Anurag batra
def main():
    print("Hello World!")

if __name__ == "__main__":
    main()

Here is what the above code is Doing:
1. Defining a function named main.
2. Printing a string.
3. Checking if the __name__ variable is equal to __main__.
4. Calling the main function.

Categories Python Examples
Post navigation
python trick big numbers visualisation
show image in python
© MyEduKit - 2022 . All Rights Reserved.