I have two lists with usernames and I want to calculate the Jaccard similarity. Is it possible? 

[This](https://stackoverflow.com/questions/11911252/python-jaccard-distance-using-word-intersection-but-not-character-intersection) thread shows how to calculate the Jaccard Similarity between two strings, however I want to apply this to two lists, where each element is one word (e.g., a username).
['https://Stackoverflow.com/questions/46975929', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/873309/']
For Python 3:

```
def jaccard_similarity(list1, list2):
    s1 = set(list1)
    s2 = set(list2)
    return float(len(s1.intersection(s2)) / len(s1.union(s2)))
list1 = ['dog', 'cat', 'cat', 'rat']
list2 = ['dog', 'cat', 'mouse']
jaccard_similarity(list1, list2)
>>> 0.5

```

For Python2 use `return len(s1.intersection(s2)) / float(len(s1.union(s2)))`
@aventinus I don't have enough reputation to add a comment to your answer, but just to make things clearer, your solution measures the `jaccard_similarity` but the function is misnamed as `jaccard_distance`, which is actually `1 - jaccard_similarity`