Akuma no Riddle, Ansatsu Kyoushitsu: Jump Festa 2013 Special Recommendations
Students are trained to kill. But they must kill their principle/friend in order pass. One series is a comedy while the is not.
Both animes happen in a school, in both they should kill a target and all the students are assassins who needs to kill this target.
The differences are that in Akuma no Riddle the students are all girls and have more rules to make the murder success (because of that the target is a girl too).
Whereas Ansatsu Kyoushitsu is longer, the amount of students and its variety is greater and the most important thing is that the target is a yellow octopus teacher.