Can anyone please explain this?
userData = 10
emptyList = [0] * userData
for i in emptyList:
emptyList[i] = userData
print(emptyList)
userData -= 1
This in my mind, this code should do something different than it does.
what I am looking for- whatever the value is for userData, I would like it to be indexed in order value in the list emptyList.
This, I thought would give me the set [10, 9, 8] and so on... it doesnt.. it only changes the first variable in each iteration
what did I do wrong?
I made it work another way, userData = 10 emptyList = [] for i in range(userData): emptyList.append(i) userData -= 1 print(emptyList)
but thats not how I like it.. I need the 0 in that set to come out as 10 I think