[Tutor] trouble getting a list to update

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Thu Jan 6 22:59:26 CET 2005



On Thu, 6 Jan 2005, Vincent Wan wrote:

> I wrote a program to repeatedly:
> 	a: print a list of integers eg 0 0 0 0 0 0 0 0 0 0
> 	b: change each integer in the list to 1 with a .05% chance
>
> I run the program and over itterations more 1's appear as they should.
>
> However, the changes printed in step a don't seem to be the same as
> those made in step b (as shown by the debug code.


Hi Vincent,

Can you show us a snippet of the file output?  I'm not immediately seeing
anything particular with your debugging output statements:

    myfile.write('base ' + str(current_base) + ' mutated to ')
    myfile.write(str(a_genome[current_base]) + '\n')

Like the computer, I don't yet understand what the problem is.  *grin*


If you can point us at the output that looks weird to you, and tell us
what you expected to see instead and why, that will help us a lot to
better understand the situation.



Best of wishes!



More information about the Tutor mailing list