나는 이렇게 학습한다/Algorithm & SQL

1017. Enumerable Magic - Does My List Include This?

daco2020 2022. 10. 17. 21:10
반응형

Create a method that accepts a list and an item, and returns true if the item belongs to the list, otherwise false.



Solution:

from typing import List


def include(arr: List[int], item: int) -> bool:
    return bool(arr.count(item))


반응형