954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Randomize numbers

I want to randomize a range of numbers without "random.shuffle." Instead it would be using "randint(0, n-1)"
If I put in 4 into the function it could return [1,3,2,0] or [3,1,0,2]. I know that starting with an empty list and running through with a while list would work.

oberlin1988
Newbie Poster
5 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

Why are you announcing this?

pyTony
pyMod
Moderator
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
 

Better use random.shuffle(), or read this first http://www.daniweb.com/forums/announcement.php?f=8&announcementid=2

Gribouillis
Posting Maven
Moderator
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: