On Wed, May 9, 2012 at 5:01 PM, Nikhil Verma <varma.nikhi...@gmail.com> wrote:
> Hi All
>
> I want to generate a random number of 8 digits which involve 3 number and 5
> digits.

(That's 3 digits and 5 letters) Pretty easy. Do you want to
distinguish between uppercase and lowercase letters?

Your current random_number function (btw, I wouldn't call it "number"
as it isn't one) is most of one possible solution. Divide it into two
parts, one part that generates the digits and another part that
generates the letters. Your 'characters' template would thus be
different for the two parts.

There are other solutions, which involve the generation of less random
numbers, but your way will work.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to