Jump to content

Generate random numbers without repeating a value: Difference between revisions

m
python version
(Realize in F#)
m (python version)
Line 181:
{13,6,8,1,9,19,5,18,2,12,11,20,4,17,10,3,15,7,14,16}
</pre>
 
=={{header|Python}}==
<lang python>
import random
 
print(random.sample(range(1, 21), 20))
</lang>{{out}}[14, 15, 3, 18, 4, 11, 16, 10, 12, 20, 13, 1, 6, 7, 2, 17, 5, 9, 19, 8]
 
 
=={{header|Raku}}==
4,108

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.