random number between 0 and 20

Christos TZOTZIOY Georgiou tzot at sil-tec.gr
Wed Apr 20 11:20:14 EDT 2005


On 20 Apr 2005 08:15:02 -0700, rumours say that
aleksander.helgaker at gmail.com might have written:

>How can I generate a random number between 0 - 20 and store the number
>in nrrandom?

Just choose a random number yourself, eg. nrrandom=17 (just kidding :)


import random

nrrandom = random.randint(0,20)

See also the random.randrange function.
-- 
TZOTZIOY, I speak England very best.
"Be strict when sending and tolerant when receiving." (from RFC1958)
I really should keep that in mind when talking with people, actually...



More information about the Python-list mailing list