diff --git a/src/random_number.py b/src/random_number.py new file mode 100644 index 0000000..680372c --- /dev/null +++ b/src/random_number.py @@ -0,0 +1,13 @@ +# Write a program that generates a random number. + +# Output: +# The random number is: 4 + +import random + + +def randomInt(a: int, b: int) -> int: + return random.randint(a, b) + + +print("The random number is: ", randomInt(1, 100)) diff --git a/src/verify.py b/src/verify.py new file mode 100644 index 0000000..a1d7643 --- /dev/null +++ b/src/verify.py @@ -0,0 +1,15 @@ +# 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. + + +Predefined_Array = [1, 5, 8, 12, 23, 30, 58, 72, 88] + +Num_To_Check = int(input("Insert number: ")) + +if Num_To_Check in Predefined_Array: + print("The number", Num_To_Check, "is present in the array") +else: + print("The number", Num_To_Check, "is not present in the array")