help how to sort a list in order of 'n' in python without using inbuilt functions??

Dan Sommers dan at tombstonezero.net
Sun May 26 00:06:34 EDT 2013


On Sun, 26 May 2013 03:38:12 +0000, Steven D'Aprano wrote:

> ... adding a constant to a random variable still leaves it equally
> random. Adding, multiplying, dividing or subtracting a constant from a
> random variable X just shifts the possible values X can take ...

That's mathematically true, but this is the Python mailing list.

Adding, subtracting, or dividing by a sufficiently large constant loses
all the randomness.

Python 3.2.4 (default, May  8 2013, 20:55:18) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
>>> random.random() + 1e200
1e+200
>>> random.random() - 1e200
-1e+200
>>> random.random() / 1e309
0.0

But you knew that.  ;-)

Dan



More information about the Python-list mailing list