title: How to create a tipping function in python
body: <p>trying to fix this code for tipping.
  Let's add a tipping function. I've created the bare-bones of the function, which will take in the cost of the meal, and ask for a percentage to tip on the meal. You do the rest!</p>
  <pre><code>def tip(cost):
  percentage = input(&quot;What percent would you like to tip? &quot;)
  tip = round(cost * percentage, 2)
  print(&quot;The tip amount of&quot;, percentage, &quot;% is &quot;, tip)
  return tip
  </code></pre>
  <p>the first part does not seem to work</p>
  <p>after that, I run</p>
  <pre><code>cost, items = order(menu)
  print(&quot;Your order is&quot;, items)
  cost = round(cost + tax(&quot;vt&quot;, cost, tax_rate), 2)
  cost = round(cost + tip(cost), 2)
  print(&quot;Your total cost is&quot;, cost)
  </code></pre>