why is my hash being weird??
pycraze
dennis.varghese at wipro.com
Thu Jan 19 10:01:01 EST 2006
You are appending to the test file. How many times have
you appended to it? Once? Twice? A dozen times? Just
what is in the file test.py after all this time?
> when input =4
> ./s 4 >test.py
>
>test.py is
> myhash = {}
> def summa():
> global myhash
> myhash[0] = 0
> myhash[1] = 1
> myhash[2] = 2
> myhash[3] = 3
>
>if now input is 100 then test py will be
>
> myhash = {}
> def summa():
> global myhash
> myhash[0] = 0
> myhash[1] = 1
> myhash[2] = 2
> myhash[3] = 3
> .......
> .......
> .......
> .......
> myhash[99] = 99
> I append only once , and that too i do this exercise to get a largely big hash.
This result came to a bit of a suprise.. when i construct large hashes
.. my system gets stalled....
So i was interested how, for this i came up with this exercise .
Anyway thanks
Dennis
More information about the Python-list
mailing list