Answer to Question #318558 in Python for Tine

Question #318558

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]

1
Expert's answer
2022-03-26T12:41:23-0400
import random 
list1 = []
for i in range(6):
    list1.append(random.randrange(0,46))
print(list1)

[15, 22, 8, 7, 38, 14]

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS