Python strings- The following code gives a list assignment error. Why is that so?

str = input()
x = []
for i in range(0,len(str)):
x[i] = str.count(str[i])