Posted Nov 10, 2010 6:18 UTC (Wed) by wahern (subscriber, #37304)
[Link]
Ha. Good catch. If it was meant between 0 and 3 inclusive then yes. And that's fair assumption in this case, because if it was meant exclusive then rand() % 3 still wouldn't be right; you'd need (rand() % 2) + 1.
You can take the programmer out of the python.
Posted Nov 10, 2010 13:42 UTC (Wed) by gmatht (guest, #58961)
[Link]
But you can't take the python out of the programmer.
$ python
>>> range(0,3)
[0, 1, 2]
Perhaps he was testing the secret rewrite of Linux in Python? ;)