-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(verify.py): implemented function verify and its test
- Loading branch information
FilippoMarletta
committed
Nov 8, 2023
1 parent
c446327
commit 7e8be4e
Showing
2 changed files
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def verify(l:list[int], v:int ) -> bool: | ||
for x in l: | ||
if x == v: | ||
return True | ||
return False | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from src.verify import verify | ||
|
||
def test_verify() -> None: | ||
assert verify([1,2,3], 2) == True | ||
assert verify([1,2,3], 4) == False | ||
|