Day: <span>December 27, 2001</span>

I’m trying to read some Python code today, and I ran into something I don’t understand. What does the following mean in Python?:

x = [0] * (2 * 2)

If I understand correctly, the value of X after that line executes will be:

[0, 0, 0, 0]

…but I’m not sure. My brain doesn’t know how to parse multiplication of a dictionary object (yet). I’m sure that somewhere on, there are docs about this, but I haven’t found them yet. Anyone know the answer?

Jake's Brainpan

Comments closed

I have an admission to declare: Every time I see DayPop, my brain says “Day-Poop”. I wonder what would Freud say?

Jake's Radio 'Blog

Comments closed