Антипова Алёна 425 гр. RandBits 2830
squizyCake RandBits 4215
f1import randomf1import random
22
3def randbits(p, n):3def randbits(p, n):
4    if not 1 <= n <= p:4    if not 1 <= n <= p:
5        return 05        return 0
t6    position = random.sample(range(p), n)t6    pos = random.sample(range(p), n)
7    num = 07    x = 0
8    for pos in position:8    for i in pos:
9        num |= 1 << pos9        x |= 1 << i
10    return num10    return x
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op