Question #307031

Machine problem 2


Create a Python script that will generate random n integers from a given start and end of a range.


Sample Output:


Value for n:5


Value for start: 1


Value for end : 10


10 8 7 8 3

Expert's answer

import random
randomlist = []
for i in range(0,5):
  n = random.randint(1,30)
  randomlist.append(n)
print(randomlist)
LATEST TUTORIALS
APPROVED BY CLIENTS