Random Numbers in Python

Write a Program in Python to find Random Numbers.

Random Number Using for loop

The randint() function with loop can be used to produce a list of random numbers.

Step 1: Create an empty list

Step 2: Append the random numbers produced to the empty list one by one.

Output

[37, 48, 33, 22, 35, 29, 11, 1, 37, 3, 7, 1, 21, 49, 5, 9, 49, 38, 29, 19]

Output

[21, 6, 39]