0

If I have a list C, how do I find out how many times each element is repeated?

This is the rule that I use to get the list:

dna([X, Y]) :-
   aminotodna(X, A),
   aminotodna(Y, B),
   append(A, B, C),
   print(C),
   nl,
   fail.
lurker
  • 56,987
  • 9
  • 69
  • 103
hope
  • 1
  • 3
  • 1
    A student of your year had a similar question yesterday, or was it you? (The question has been deleted since). – SQB Mar 11 '16 at 12:35
  • 2
    [Here](http://stackoverflow.com/a/35542014/1812457) is a very detailed answer as to how to count occurrences in a list. It is not a complete answer, because the question looked like a homework question. I would also suggest looking up [how to ask a good question](http://stackoverflow.com/help/how-to-ask), what is a [MVCE](http://stackoverflow.com/help/mcve), and a discussion on [homework questions](http://meta.stackexchange.com/questions/10811/how-do-i-ask-and-answer-homework-questions) –  Mar 11 '16 at 12:42

0 Answers0