본문 바로가기
나는 이렇게 학습한다/Algorithm & SQL

1017. Enumerable Magic - Does My List Include This?

by daco2020 2022. 10. 17.

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))