Append a new item to a list within a list

Viewed 23018

I'm trying to append a new float element to a list within another list, for example:

list = [[]]*2
list[1].append(2.5)

And I get the following:

print list
[[2.5], [2.5]]

When I'd like to get:

[[], [2.5]]

How can I do this?

Thanks in advance.

8 Answers
Related