title: Why can't I covert a string with a number into an integer?
body: <pre><code>def main():
      handling_cost = 5
      cost_per_item = 4.25
      prompt = &quot;Enter number (5 - 20): &quot;
      get_number(prompt)
      int(prompt)
      get_cost(prompt, cost_per_item, handling_cost)
      display_details(prompt, cost_per_item)
      
  
  def get_number(prompt):
      return int(input(prompt))
  def get_cost(number, cost_per_unit, handling_cost):
      total_cost = number * cost_per_unit + handling_cost
      return round(total_cost)
  def display_details(items, cost_each, handling_cost, final_price):
      print(&quot;Items: &quot;, items, &quot; Cost per item: $&quot;, cost_each, sep=&quot;&quot;)
      print(&quot;Handling cost: $&quot;, handling_cost, sep=&quot;&quot;)
      print(&quot;Total $&quot;, final_price, sep=&quot;&quot;)
  main()
  </code></pre>
  <p>Hi there,</p>
  <p>I'm having trouble converting a string number into an integer.</p>
  <p>On line 6 of my code, I try to convert the prompt into an integer so it can be converted into an integer and then multiplied in the get_cost function. But I get the error message shown below:</p>
  <p>How do  I fix this?</p>
  <p><a href="https://i.stack.imgur.com/AcL1c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AcL1c.png" alt="enter image description here" /></a></p>