PseudoRandom-IntAU 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pseudorandom_intau-1.0.0/PKG-INFO +7 -0
- pseudorandom_intau-1.0.0/pyproject.toml +14 -0
- pseudorandom_intau-1.0.0/setup.cfg +4 -0
- pseudorandom_intau-1.0.0/src/PseudoRandomAU/RandomIntegerAU.py +32 -0
- pseudorandom_intau-1.0.0/src/PseudoRandomAU/__init__.py +6 -0
- pseudorandom_intau-1.0.0/src/PseudoRandom_IntAU.egg-info/PKG-INFO +7 -0
- pseudorandom_intau-1.0.0/src/PseudoRandom_IntAU.egg-info/SOURCES.txt +7 -0
- pseudorandom_intau-1.0.0/src/PseudoRandom_IntAU.egg-info/dependency_links.txt +1 -0
- pseudorandom_intau-1.0.0/src/PseudoRandom_IntAU.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
[build-system]
|
|
3
|
+
requires = ["setuptools>=61"]
|
|
4
|
+
build-backend = "setuptools.build_meta"
|
|
5
|
+
|
|
6
|
+
[project]
|
|
7
|
+
name = "PseudoRandom-IntAU"
|
|
8
|
+
version = "1.0.0"
|
|
9
|
+
description = "Pseudo Random Number"
|
|
10
|
+
authors = [{name="Andreas Urech", email="andreas.urech@ch.abb.com"}]
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
license = {text = "MIT"}
|
|
13
|
+
dependencies = []
|
|
14
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import random
|
|
3
|
+
|
|
4
|
+
def generate_random_integer(lower_bound, upper_bound):
|
|
5
|
+
"""
|
|
6
|
+
Generate a pseudo-random integer between two bounds (inclusive).
|
|
7
|
+
|
|
8
|
+
Parameters:
|
|
9
|
+
lower_bound (int): The minimum value of the random range.
|
|
10
|
+
upper_bound (int): The maximum value of the random range.
|
|
11
|
+
|
|
12
|
+
Returns:
|
|
13
|
+
int: A pseudo-random integer between lower_bound and upper_bound.
|
|
14
|
+
|
|
15
|
+
Raises:
|
|
16
|
+
ValueError: If lower_bound is greater than upper_bound.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
# Validate input: lower bound must not exceed upper bound
|
|
20
|
+
if lower_bound > upper_bound:
|
|
21
|
+
raise ValueError("Lower bound must be less than or equal to upper bound.")
|
|
22
|
+
|
|
23
|
+
# Generate and return a random integer within the specified range
|
|
24
|
+
# random.randint(a, b) includes both endpoints a and b
|
|
25
|
+
random_number = random.randint(lower_bound, upper_bound)
|
|
26
|
+
|
|
27
|
+
return random_number
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# Example usage
|
|
31
|
+
# if __name__ == "__main__":
|
|
32
|
+
# print(generate_random_integer(1, 10))
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pyproject.toml
|
|
2
|
+
src/PseudoRandomAU/RandomIntegerAU.py
|
|
3
|
+
src/PseudoRandomAU/__init__.py
|
|
4
|
+
src/PseudoRandom_IntAU.egg-info/PKG-INFO
|
|
5
|
+
src/PseudoRandom_IntAU.egg-info/SOURCES.txt
|
|
6
|
+
src/PseudoRandom_IntAU.egg-info/dependency_links.txt
|
|
7
|
+
src/PseudoRandom_IntAU.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PseudoRandomAU
|