>I find out that the outcome for using .join() on a dictionary is totally
>different than it using on list or string. for example,
> >>> seq4 = {'hello':1,'good':2,'boy':3,'doiido':4}
> >>>
> boy:good:doiido:hello
>So my question is why the outco
Danny Yoo wrote:
> Moreover, most implementations *deliberately* randomize their iteration
> order to avoid a particular kind of hash collision attack out there in
> the wild. See:
In CPython the hash() of a string may change between different runs to fend
off hash collision attacks, but that
> That's because dictionaries are not stored sequentially and the
> order of retrieval is not guaranteed - it can even change
> during the execution of a program so you should never
> depend on it. That's because dictionaries are optimised
> for random access via the keys not to be iterated over.
On 13/02/17 18:34, SIJIA CHEN wrote:
> I find out that the outcome for using .join() on a dictionary is
> totally different than it using on list or string.
Not really, it just looks like that :-)
>
> >>> seq4 = {'hello':1,'good':2,'boy':3,'doiido':4}
> >>> p
> On Feb 13, 2017, at 12:34, SIJIA CHEN wrote:
>
> I find out that the outcome for using .join() on a dictionary is totally
> different than it using on list or string. for example,
>
seq4 = {'hello':1,'good':2,'boy':3,'doiido':4}
print ':'.join(seq4)
> boy:good:doii
Dear, all,
I am a python novice and I am wondering if someone in the group could help me
with a easy question about .join() method!
I find out that the outcome for using .join() on a dictionary is totally
different than it using on list or string. for example,
>>> seq4 = {'he