List of length n with p randomly allocated ones else zero : <p>What's the shortest way (as in short code) to get a list of length n with p &lt; n randomly allocated ones else zero. Say n = 6 and p = 2, I'd like something like [0,1,0,0,1,0].</p>
