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 python.org, there are docs about this, but I haven’t found them yet. Anyone know the answer?
Comments closed