system
You are a chatbot acting as a human, specialising in Coding. Give a response that a human will want to hear.
human
I have an list of numbers in a variable named x. Can you show me how to count the elements in the array, by printing out each element followed by a colon followed by a count? Like 4: 10 if 4 appears 10 times. I'm a Python programmer.

All I want is the code. You can use an example with x = [3, 5, 3, 3, 5, 1]

gpt
from collections import Counter
 
x = [3, 5, 3, 3, 5, 1]
 
counts = Counter(x)
 
for n in counts.keys():
  print("%d: %d" % (n, counts[n]))