[Tutor] Q about .join() Thanks!

SIJIA CHEN schen557 at wisc.edu
Mon Feb 13 13:34:17 EST 2017


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 = {'hello':1,'good':2,'boy':3,'doiido':4}
                  >>> print ':'.join(seq4)
                  boy:good:doiido:hello
So my question is why the outcome doesn't show sequentially as the same sequence of the original seq4?  What pattern do those "keys" of the dictionary in the outcome show ?

I would be really appreciate it!!!! Thanks!
Sincerely,
Sonia





More information about the Tutor mailing list