← Back to challenges

Check if a List Contains a Given Number

PythonMediumarraysvalidationlanguage_fundamentals

Instructions

Write a function to check if a list contains a particular number.

Examples

check([1, 2, 3, 4, 5], 3) ➞ True

check([1, 1, 2, 1, 1], 3) ➞ False

check([5, 5, 5, 6], 5) ➞ True

check([], 5) ➞ False
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.