Q:

simple python loop that makes a new line once it reads a new value

I am new to python. I am trying to apply a loop over a sorted list. the idea is whenever the loop reads a new value different from the previous one it makes a new line before it (the editor I am using is jupyter notebook)
what I've tried is 
d=[1,1,1,2,2,3,4,5,5,5]
for i in d:
  if i == d[i]:
     print(i)
  elif i != d[i]:
     print(i)
     print('\n')

The expected output should be something like this
1
1
1
*new line*
2
2
*new line*
3
*new line*
4
*new line*
5
5
5

but unfortunately this code didn't do the job. Thanks for your help, I appreciate it.

A:

If the current number isn't equal to previous one, print a new line before printing the item.
d=[1,1,1,2,2,3,4,5,5,5]

for i in range(len(d)):
  if i > 0 and d[i] != d [i - 1]:
      print('\n')
  print(d[i])

