main() function use in python

Before we program more in front of Python, we know about using the main()function in Python
Consider the following code:-
Source code:

def main():
       print("Hello!")
print("hii")

main() function
output:-
hii
  1. Only "Hello!" print
  2.  not the code "hii" print
 The call function "if__name__== "__main__".
Source code:

def main():
      print("Hello!")
if__name__=="__main__":
          main()
print("hii")


use main() function
output:- 

Hello!
hii