Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Python | Random elements with atleast K occurrences
import random N = 7;K = 3;val = 10; strt, stp = 9, 12; l=[val]*K ll=[i for i in range(strt,stp+1)] for i in range(N-K): l.append(random.choice(ll)) random.shuffle(l) print(l)
run
|
edit
|
history
|
help
1
31 dec string
Select fruits
pythonic way (V2)
Pierwiastkowanie
Sum of subsets (Python)
PyRegSetRange
5
Rektangel
Code hello world
Swapping.py