Skip to content

Commit

Permalink
feat: verify exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
GianmarcoBasile committed Oct 30, 2023
1 parent c446327 commit 4c44f89
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/verify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Write a software that verifies if a number is present in a pre-defined array.

# Output example:
# Insert number 3
# The number 3 is [not] present in the array.

def isPresent(N: list, n: int) -> bool:
return n in N

def main():
n = int(input("Insert number: "))
N = [3, 4, 5, 1, 2, 3, 4, 9, 13, 0]
if isPresent(N, n): print(f"The number {n} is present in the array.")
else: print(f"The number {n} is not present in the array.")

if __name__ == "__main__":
main()

0 comments on commit 4c44f89

Please sign in to comment.