title: Finding the mistake in my Dog years to human years program
body: <p>I am a beginner in python.</p>
  <ol>
  <li><p>If the input is 5 how do i make the output 33 be printed only once?</p>
  </li>
  <li><p>The most important question:Is there an algorithm to replace the need to write 21?</p>
  </li>
  </ol>
  <p>Here is the original question:</p>
  <blockquote>
  <p>It is commonly said that one human year is equivalent to 7 dog years.Some people believe that it is better to count each of the first two human years as 10.5 dog years, and then count each additional human year as 4 dog years</p>
  </blockquote>
  <pre class="lang-py prettyprint-override"><code>dog_years=int(input(&quot;Enter the age of the dog to get it's equivalent for it's owner:&quot; ))
  dog_age_to_human_age_1=10.5*dog_years
  dog_age_to_human_age_2=4*(dog_years-2)
  dog_1=[]
  
  if dog_years &lt;= 0:
      print(&quot;Please Enter an positive integer whole number&quot;)
      exit()
  elif dog_years &gt; 0 and  dog_years &lt;= 2:
      print(dog_age_to_human_age_1)
      dog_1.append(dog_age_to_human_age_1)
  
  
  for dog_years in range(3,dog_years+1):
      dog_1.append(dog_age_to_human_age_2)
      print(dog_1[-1]+21)               #is there an algorithm to replace the 21?
  </code></pre>