title: PYTHON: IF Statements for DICT
body: <p>i have a <code>dict</code> which contains data from my <code>csv</code> file:</p>
  <pre><code>Standard rules1: Weight &lt;= 1200 |
                   Height &lt;= 220 |
                   Width  &lt;= 100 |
                   Length &lt;= 120
  
  Standard rules2: Weight &lt;= 750 |
                   Height &lt;= 120 |
                   Width  &lt;= 100 |
                   Length &lt;= 120 |
  </code></pre>
  <p>my dict:</p>
  <pre><code>pwData = {'Weight':row[0], 'Length':row[3], 'Width':row[4], 'Height':row[4], 'Rule' : ''}
  </code></pre>
  <p>what i want is:</p>
  <pre><code>if pwData['Weight'] &lt;= '750' and pwData['Height'] &lt;= '160':
      pwData['Rule'] = '1'
  elif pwData['Weigt'] &lt;= '750' and pwData['Height'] &lt;= '120':
      pwData['Rule'] &lt;= '2'
  </code></pre>
  <p>What i get in the firs if statement:
  Rule <code>2</code> but i need to get the rule <code>1</code></p>