You can adjust the range you want the random number to be chosen from with the arguments to randint(). Not that this will make it difficult to access the values from this dict however.

Also, there is a potential with this method for having data overwritten if each_list[0].replace('.', '') and rand_key happen to have the same value as a previous key. If this is not an issue, then this method should work for you. If it is, you could generate your "random" number with a timestamp:

Which should give you a unique key unless the same value for each_list[0].replace('.', '') comes up twice in the same microsecond. See http://strftime.org/ for an explanation of the format codes passed to strftime().

Email codedump link for Change a dictionary value whilst iterating over it