Uncategorized

I don’t understand the main() function in Python


I am a Python beginner, I started learning Python two weeks ago. In the first lecture, the professor explains the main() function; however, I didn’t get it. I have two questions:

  1. What does the main function do?

  2. Why can’t I just go back to the beginning of my program and define any function I want to use without writing a main function?

I tried searching on Google for answers; however, I didn’t find anything useful.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *