title: Python __name__() main function
body: <p>I have tried looking for an answer online but couldn't find it. I am fairly new to python and wondering if you could have multiple main function in a program. For example:</p>
  
  <pre><code>ask_user = int(input('enter your choice (1 or 2): '))
  
  if ask_user == 1:
      def print_hello():
          print('hello world')
      def main():
          print_hello()
  
      if __name__ == '__main__': main()
  
  elif ask_user == 2:
      def print_hi():
          print('hi')
      def main():
          print_hi()
  
      if __name__ == '__main__': main()
  </code></pre>
  
  <p>Is this a good programing practice?</p>