Question #318752

Develop a Python application that will randomly select n integers from 1 to 45 without repetitions.


Sample Output 1:


How many numbers? 6 6 randomly selected nos. [21, 35, 16, 36, 5, 8]

Expert's answer

import random

n = int(input('How many numbers? '))

L = random.choices(range(1,46), k=n)
print(n, 'randomly selected nos.', L)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS