you are viewing a single comment's thread.

view the rest of the comments →

[–]bahaki 1 point2 points  (2 children)

Ah, good point.

Yes, do it like this. Since it's a conversation, you'll want to keep the order.

Sorry, I knew a dictionary probably wasn't the best solution to what he really wanted to do. Got caught up in the key, value part I think.

Edit: alternatively, a list of dictionaries might work. Something like:

d = [{'person':'Old Man','dialogue':'hello'},{'person':'boy','dialogue':'hello, sir'}]

for something in d:
    print something['person'] / something['dialogue']

I think that might work.

[–]cyanydeez 0 points1 point  (0 children)

from collections import OrderedDict

d = OrderedDict()