title: in Python how do I print the result of a calculation and then save the result to a variable?
body: <p>I am learning python and I am challenging myself to write a little program that asks the user the base price of a car, then saves the base price to a variable called <code>base</code>. It has two other variables called <code>tax</code> and <code>license</code> that are percentages. So it gets the base price, gets <code>seven (7)</code> percent of the <code>base</code> price, and adds it to the base price. It does the same for the license fee, etc.</p>
  <p>However, what I want to know is that when it runs:
  <code>print &quot;\nAfter taxes the price is: &quot;, (base * tax / 100 + base)</code>
  how can I save the result to another variable so that the next line I dont have to write:
  <code>print &quot;\nAfter taxes and license fee the price is: &quot;, (base*tax / 100)+(base*license /100) + base?</code> Rewriting it feels very redundant and like I'm wasting time by calculation something that has already been calculated.</p>
  <p>I want to save the result of the first <code>print</code> line to a variable called <code>after_tax</code> so that then I could write:
  <code>print &quot;\nAfter taxes and license fee the price is: &quot;, after_tax + (base*license /100)</code></p>
  <p>(I want the first <code>print</code> command to also save the result of the math calculation to a variable called <code>after_tax</code> so that I can reuse the result without having to retype out the entire calculation to get the result again).</p>
  <h3>Below is the code in it's entirety:</h3>
  <pre><code>#Car salesman calculations program.
  
  base = int(raw_input(&quot;What is the base price of the car?&quot; + &quot;\n&quot;))
  tax = 7
  
  license = 4
  
  dealer_prep = 500
  
  destination_charge = 1000
  
  
  print &quot;\nAfter taxes the price is: &quot;, (base * tax / 100 + base)
  
  print &quot;\nAfter taxes and license fee the price is: &quot;, (base*tax / 100)+(base*license /100) + base
  
  print &quot;\nAfter taxes and license fee and dealer prep the price is: &quot;, (base*tax / 100)+(base*license /100) + base + dealer_prep
  
  print &quot;\nAfter taxes, license fees, dealer prep, and destination charge, the total price is: &quot;, (base*tax / 100)+(base*license /100) + base + dealer_prep + destination_charge
  
  raw_input(&quot;\nPress the enter key to close the window.&quot;)
  </code></pre>