fork download
  1. yy =[]
  2. i=0
  3. j=0
  4. n=0
  5. c=[]
  6. c[0]=0
  7. d=[]
  8. e=1
  9. A=[84,105,103,81,67,101,106,80,78,62]
  10. for x,y in zip(A[0::],A[1::]):
  11. z=y-x
  12. if(z>0):
  13. print (x,y,z,1)
  14.  
  15. yy.append(1)
  16.  
  17. else:
  18. print(x,y,z,0)
  19. yy.append(0)
  20. print (yy)
  21. print(yy[0])
  22.  
  23.  
  24. #d[n]=0
  25. for n in range(0,9):
  26. for j in range(0,9):
  27. for a,b in zip(yy[0::],yy[1::]):
  28. #a[j]=1
  29. if(a==b):
  30. next=c[j] + 1
  31. #print(next)
  32. c.insert(j+1,next)
  33.  
  34. else:
  35. if(j<9):
  36. #c[j+1] = 1
  37. #c.append
  38. c.insert(j+1,1)
  39.  
  40. d.insert(n,c[j])
  41. # print(d[n])
  42. n=n+1
  43. j=j+1
  44.  
  45. d[n] = c[j]
  46. n=n+1
  47. j=j+1
  48.  
  49. for n in range(0,9):
  50. print(c[n]) # your code goes here# your code goes here
Runtime error #stdin #stdout #stderr 0.01s 9024KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 6, in <module>
IndexError: list assignment index out of range