Find the error

Report a typo

There's a function to calculate Jaccard similarity. But the method does not produce the result we want. Write the incorrect line according to the specified numbering.

def jaccard_similarity(list1, list2):
    common = len(set(list1).intersection(set(list2)))       # 1
    list1_count = len(set(list1))                           # 2
    list2_count = len(set(list2))                           # 3
    return common / (list1_count - list2_count - common)    # 4
Enter a number
___

Create a free account to access the full topic