the python default commands are:
random(), give a number between 0 and 1 (never 1)
randrange(start, stop, step), give a number between start and stop (never stop)
But I don't know if civ4 use these commands, since they are in module random. So try it!
For more info, go on idle and...