File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1212
1313
1414def make_dataset () -> tuple [list [int ], int ]:
15+ """
16+ Generates a random dataset.
17+
18+ Returns a tuple where:
19+ - The first element is a list of 10 integers, each between -1000 and 1000.
20+ - The second element is a single integer between -5000 and 5000.
21+
22+ Example usage (outputs will vary because of randomness):
23+ >>> arr, r = make_dataset()
24+ >>> isinstance(arr, list)
25+ True
26+ >>> len(arr)
27+ 10
28+ >>> all(isinstance(x, int) for x in arr)
29+ True
30+ >>> isinstance(r, int)
31+ True
32+ >>> -1000 <= min(arr) <= 1000
33+ True
34+ >>> -1000 <= max(arr) <= 1000
35+ True
36+ >>> -5000 <= r <= 5000
37+ True
38+ """
1539 arr = [randint (- 1000 , 1000 ) for i in range (10 )]
1640 r = randint (- 5000 , 5000 )
1741 return (arr , r )
You can’t perform that action at this time.
0 commit comments