a = [[1,1],[3,1.5],[5,0]]
  for i in range(len(a)) :
    if a[i][1] > a[i-1][1] :
        print 'greater !!'
    else:
        print "smaller"
  greater !!
  greater !!
  smaller
  
Thanks for taking the time to help me Aditya.  I tried the code but have 
encountered a problem.  In this new list,
[1,    1]
[3,    1.5]
[5,    0]
  only the second and third "greater" and "smaller" output are correct as 1.5 
is larger than 1 and 0 is smaller than 1.5.  What is i[1] greater than?  
  I also tried using + for next item instread, but that produced an error.  Why?
    if a[i][1] > a[i+1][1] 

       
---------------------------------
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to