2011/7/5 Válas Péter <suli...@postafiok.hu>: > Hi, > > I have a dictionary with the keys 'a' and 'b'. It is not in a class. (I know > that everything is in a class, but not explicitly.) > May I use the value of 'a' when defining the value of 'b'? If so, what is > the syntax?
Yes. The syntax is the same as anything involving a dict - >>> a_dict = dict() >>> a_dict['a'] = 2 >>> a_dict['b'] = a_dict['a'] + 1 >>> a_dict {'a': 2, 'b': 3} _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor