[Tutor] Deleted dictionary length not reporting

Jim Mooney cybervigilante at gmail.com
Wed Jul 17 05:25:23 CEST 2013


On 16 July 2013 20:11, eryksun <eryksun at gmail.com> wrote:


> The system random is an instance of random.Random, which already calls
> self.seed():
>
Ah, good, saving steps is always good.

> I'd use random.sample:

Another saving. Can I assume random.sample is designed to Not pick duplicates?

And I found the index error (in the original prog, that uses a list,
not a dict). I was thinking of range and such, that cuts off the last
value, but randint doesn't cut off the end value.

-- 
Jim

I sure love that Guv-a-Mint Cheese, Guv-a-Mint Cheese, Guv-a-Mint Cheese
Oh please Guv-a-Mint, Guv-a-Mint please,
Please bring back that Guv-a-Mint Cheeeeeeeeese!


More information about the Tutor mailing list