[Tutor] Using a dict value in the same dict

Steven D'Aprano steve at pearwood.info
Wed Jul 6 00:27:38 CEST 2011


Válas Péter wrote:
> So the trick is to define the dictionary in separate sessions, not at once.

No.


value = 42
my_dict = {'a': value, 'b': value, 'c': 23, 'd': value, 'e': 97}

will work fine too.



-- 
Steven



More information about the Tutor mailing list