Python - drawing randomly n numbers integer from range -
I think that when I use getn , I want to get the same effect , But it should be an integer number from the interval to [1 ... 100]
Import Rendin Randint From Random (1, 100) # = & gt; 86 If you want a bunch of numbers,
def getn_rand (n): randint (1, 100) _ for category (n )] or if the number should be different (no duplicate),
random import sample def get_rand_distinct (n) from: Return sample (range ( 1, 101), n)
Comments
Post a Comment