title: Using int() to convert a user's input from raw_input()
body: <p>I'm learning about functions in Python 2.7.x and one of the suggestions in the book I am using is to solicit input from a user to get values for the script. The advice on how to use <code>raw_input</code> in a function is as follows:</p>
  
  <blockquote>
    <p>You need to use int() to convert what you get from raw_input()</p>
  </blockquote>
  
  <p>I'm not sure how to use <code>int()</code> yet. This is what I have tried so far:</p>
  
  <pre><code>def cheeses_and_crackers(cheeses, crackers):
      print "You have %d types of cheeses." % cheeses
      print "You have %d types of crackers." % crackers
      print "That is a lot of cheese and crackers!\n"
  
  print "How many cheeses do you have?"
  cheeses1 = raw_input("&gt; ")
  int(cheeses1)
  
  print "How many types of crackers do you have?"
  crackers1 = raw_input("&gt; ")
  int(crackers1)
  
  cheeses_and_crackers(cheeses1, crackers1)
  </code></pre>
  
  <p>The error I get when I try run this is as follows:</p>
  
  <blockquote>
    <p>TypeError: %d format: a number is required, not str</p>
  </blockquote>
  
  <p>I'm guessing how to use <code>int()</code> so I'd appreciate some help with basic syntax too.</p>