Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-250

Annotator Agreement Percent

Problem

Return the percent agreement between two equal-length label lists: 100 * matches / n. Return 0.0 when the lists are empty or their lengths differ.

Test cases

case 1
in: [["a","b","a"],["a","b","b"]]
expected: 66.66666666666667
case 2
in: [[],[]]
expected: 0
case 3
in: [["x"],["x"]]
expected: 100
case 4
in: [["a","b"],["b","a"]]
expected: 0
Starter codePython
def agreement_percent(a, b):
    # Your code here
    pass

4 test cases · run your code against them in the editor