On 20/09/2016 13:12, 38016226...@gmail.com wrote:
d = {} keys = range(256) vals = map(chr, keys) map(operator.setitem, [d]*len(keys), keys, vals)It is from python library. What does [d]*len(keys) mean? d is the name of dict but put d in [] really confused me.
if len(keys) is 5 then [d]*5 is: [d,d,d,d,d] [d] is a list, containing one item, a dict if that is what it is. -- Bartc -- https://mail.python.org/mailman/listinfo/python-list