Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
# The number 3 is [not] present in the array.
#
#
# #include <iostream>
# using namespace std;
#
# int main()
# {
# // placeholder
# int N[10] = {3, 4, 5, 1, 2, 3, 4, 9, 13, 0};
#
# return 0;
# }


def contains(n: int) -> bool:
arr = [1, 2, 3, 4]
return n in arr


if __name__ == "__main__":
print(contains(1))
print(contains(5))
8 changes: 8 additions & 0 deletions tests/test_verify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from src.verify import contains


def test_contains() -> None:
assert contains(5) == False
assert contains(1) == True
assert contains("1") == False
assert contains(1.0) == True
Loading