[Tutor] Inclusivity

Alan Gauld alan.gauld at yahoo.co.uk
Sat Jun 13 18:44:27 EDT 2020


On 13/06/2020 17:27, Michael Deslippe wrote:
> When generating a random integer, ala;
> 
> myNum = random.randint(0, 1000000)
> 
> Is the range of integers inclusive or exclusive of the seed values 

When in doubt use the tools:

#############################
Help on method randint in module random:

randint(self, a, b) method of random.Random instance
    Return random integer in range [a, b], including both end points.
(END)
###########################



-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list