 # generate x random integers between y and z? [duplicate]

• Last Update :
• Techknowledgy :
```import random
random.sample(range(31), 10)```
```>>> n = [] >>>
while len(n) <= 10:
x = randint(0, 30)
if x not in n:
n.append(x)```

Suggestion : 2

Last Updated : 16 Aug, 2022

Examples:

```Input: num = 10, start = 20, end = 40
Output: [23, 20, 30, 33, 30, 36, 37, 27, 28, 38]
Explaination: The output contains 10 random numbers in range[20, 40]

Input: num = 5, start = 10, end = 15
Output: [15, 11, 15, 12, 11]
Explaination: The output contains 5 random numbers in range[10, 15]```

Output:

```Random integers between 0 and 9:
4
7
2
8
4
6
2
3
1
5
3```

Output:

`[23, 20, 30, 33, 30, 36, 37, 27, 28, 38]`

Suggestion : 3

06/09/2022

## Syntax

`  Number: = RANDOM(MaxNumber)`
Text constant name ENU Value
Text000 Number1 = %1, Number2 = %2, Number3 = %3
```  x: = 100; // x is assigned a positive value.
y: = -100; // y is assigned a negative value.
z: = 0; // z is assigned zero.
Number1: = RANDOM(x);
Number2: = RANDOM(y);
Number3: = RANDOM(z);
MESSAGE(Text000, Number1, Number2, Number3);```

Suggestion : 4

Random Number Functions,Random Number Generation,Random Number Data Types,Controlling Random Number Generation

```rng('default')
r1 = rand(1000, 1);```
`r2 = randi(10, 1000, 1);`
`r3 = randn(1000, 1);`
`r4 = randperm(15, 5);`
```rng('default')
A = rand(1, 5);
class(A)```
`ans = 'double'`