title: Classify a list of numbers based on their values in Python
body: <p>I am trying to write a loop in python that reads a text file of 50 numbers and sorts through the numbers and assigns them to different variables based on their values. I would like variable A to contain values less than 2, variable B to to contain values from 2 to 2.1, Variable c to contain values from 2.1 to 2.25, variable d to contain values from 2.25 to 2.5, and variable e to contain values from 2.25 to 2.5. </p>
  
  <p>My code so far looks like this: </p>
  
  <pre><code>import os
  import numpy
  os.chdir('/Users/DevEnv')
  
  dispFile = open('output1.txt')
  displacement = dispFile.readlines()
  dispFile.close()
  
  displacement = [float(i.strip()) for i in displacement]
  
  
  for i in range (0,50):
     displacementval = displacement[i]
     if i&lt;2 displacementval()=a():
  </code></pre>
  
  <p>However, when I try to run this I get an invalid syntax error. I am new to python and programming and would appreciate any help!</p>