title: Trying to create object in main method , but getting error. Python 3
body: <p>When I am trying to create "Employee" object in main method , program is giving error.</p>
  
  <pre><code>class Employee: 
      empCount = 0
  
      def __init__( self , name , salary ):
          self.name = name ;
          self.salary = salary ;
          Employee.empCount += 1 ;
  
      def displayCount( self ):
          print( "Total Employee: %d" % Employee.empCount ) ;
  
      def displayEmployee( self ):
          print( " Name:  ",self.name ) ;
  
  def main():
      emp1 = Employee("Alfanzo Cruz" ,3233)
  #   emp2 = Employee(" Frernando " , 32323 ) ;
  #   emp3 = Employee("Snoop Dogg",23232) ;
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>`</p>
  
  <p><a href="https://i.stack.imgur.com/NDcEO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NDcEO.png" alt="enter image description here"></a></p>
  
  <p>I have gone through various links but could not understand the problem , class is always global why it is giving error ? . I am beginner in python , and struck for hours in this. Any help is appreciated.</p>