When creating thelist, it's saving a reference to the same object (a) in each position. When you append to the first element, it's actually appending to a in all the "thelist" slots. What you need to do is a deep copy on the object during construction:
thelist = []
a = [0]
for i in range(5):
thelist.append(list(a))
print(thelist)
Then the following append will work as desired.