Entry Point

Last updated: Mon. Sep. 14, 2026

Ever heard of an "entry point" in programming? ?

It just means: where does the program actually start running?

In C#, it's always Main() — the compiler looks for it specifically, no matter where it lives in your project:

class Program { static void Main() { Console.WriteLine("Hello, world!"); } }

Python doesn't need one at all. A file just runs top to bottom:

print("Hello, world!")

But you've definitely seen this pattern before:

if __name__ == "__main__": main()

That's not a rule, it's a convention. __name__ only equals "__main__" when you run the file directly — not when something else imports it. So this trick lets one file work as both a script and an importable module. ?

TL;DR: C#, Java, and C force an explicit entry point. Python just uses a convention instead.

« Home