title: Index out of range appears sometimes and disappears when i run again python
body: <pre><code>import numpy 
  import matplotlib.pyplot as plt
  import serial
  
  V=[]
  I=[]
  P=[]
  count=0
  arduinoData=serial.Serial('/dev/ttyACM0',9600) # importing serial data
  
  a=input('enter the no of observation required = ') # user choice to get the required no of observations
  
  while count&lt;a:
      count=count+1
      while(arduinoData.inWaiting()==0):
          pass
      arduinoString=arduinoData.readline()
      data=arduinoString.split(",")
      voltage = float(data[0])
      current = float(data[1])
      power   = float(data[2])
      V.append(voltage)
      I.append(current)
      P.append(power)
      print V,",",I,",",P
  #plt.plot(V)`enter code here`
  #plt.show()
  #plt.ylim([150])
  </code></pre>
  
  <p>I get this error off and on sometimes the code works fine and sometimes index is out of range i'm really confused why is it so
  I have just started learning python programming  </p>