diff --git a/snippets/most_frequent.md b/snippets/most_frequent.md index 69b677626..426335470 100644 --- a/snippets/most_frequent.md +++ b/snippets/most_frequent.md @@ -3,9 +3,9 @@ title: most_frequent tags: list,beginner --- -Returns the most frequent element in a `list`. +Returns the most frequent element in a list. -Use `set(list)` to get the unique values in the `list` in combination `max()` to find the element that has the most appearances. +Use `set(list)` to get the unique values in the `list` combined with `max()` to find the element that has the most appearances. ```py def most_frequent(list): @@ -13,6 +13,5 @@ def most_frequent(list): ``` ```py -numbers = [1,2,1,2,3,2,1,4,2] -most_frequent(numbers) #2 -``` \ No newline at end of file +most_frequent([1,2,1,2,3,2,1,4,2]) #2 +```