Randomly select an interval according to the elements in the list as the step size

list1=]
how to use python to generate random intervals such as
:
[1jue 2]
[5jue 25]
[19jue 74]
[36jue 44]
[100124]
within a given range of [1200].

Feb.28,2021

na

import random

list1 = [1,20,55,8,24]

bound = (1, 200)

for step in list1:
    lower = random.randint(bound[0], bound[1] - step)
    print([lower, lower + step])

will not python


import random

list1 = [1,20,55,8,24]
random.sample([i for i in list1 if i >= 1 and i <= 200], 2)

take a closer look, it is true that my answer is not the answer to the question.

wait for the correct answer.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b125-2b7af.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b125-2b7af.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?