Chrome Extension

Random numbers List with no repetition - generate in python

The code will generate a random list with no repetitive numbers. This will contain 15 items and they will be selected from a range of 0 to 70.
import random

final_list = random.sample(range(70), 15)
print(final_list)
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
Output
[46, 14, 35, 17, 2, 13, 61, 15, 63, 30, 0, 43, 44, 39, 58]

-- Output will be different each time the code will run.
Was this helpful?
0 Comments