how to do randon in python

import random n = random. random() print(n)
import random n = random. randint(0,22) print(n)
import random randomlist = [] for i in range(0,5): n = random. randint(1,30) randomlist. ...
import random #Generate 5 random numbers between 10 and 30 randomlist = random.

Here is what the above code is Doing:
1. It’s importing the random module.
2. It’s creating a variable called n, and setting it equal to a random number between 0 and 1.
3. It’s printing the value of n.
4. It’s creating a variable called n, and setting it equal to a random number between 0 and 22.
5. It’s printing the value of n.
6. It’s creating a list called randomlist, and then it’s adding 5 random numbers to that list, all between 1 and 30.
7. It’s printing the contents of randomlist.