title: Why Python print my output two times when I import the same file in which I am printing?
body: <p>I have been playing around with python as I am a beginner in it. I wrote following class Parent which I was reading from Udacity online course.</p>
  
  <p>inheritance.py file</p>
  
  <pre><code>import inheritance  # Why this import statement causing output two times?
  
  class Parent():
      def __init__(self, last_name, eye_color):
          print("Parent Constructor Called")
          self.last_name = last_name
          self.eye_color = eye_color
  
  class Child(Parent):
      def __init__(self, last_name, eye_color, number_of_toys):
          print("Child Constructor Called")
          Parent.__init__(self, last_name, eye_color)
          self.number_of_toys = number_of_toys
  
  miley_cyrus = Child("Cyrus", "Blue", 5)
  print(miley_cyrus.last_name)
  print(miley_cyrus.number_of_toys)
  </code></pre>
  
  <p>As you can see I imported the same file in which I am currently writing class as well as printing the output. I got following output which is twice</p>
  
  <pre><code>Child Constructor Called
  Parent Constructor Called
  Cyrus
  5
  Child Constructor Called
  Parent Constructor Called
  Cyrus
  5
  </code></pre>
  
  <p>But I was expecting it only once</p>
  
  <pre><code>Child Constructor Called
  Parent Constructor Called
  Cyrus
  5
  </code></pre>
  
  <p>When I removed import statement I got the desired output (i.e. output only once ). My question is why python prints this 2 times even though I am printing it once when I use import of current file. What is happening behind?</p>