i have a problem with my python code, i try to do a list from datas from a list, my code is here:
for i in arr_of_user_id:
individual_user_id = i
print(len(arr_of_user_id) #return 4
#some code here
#amount = result of my previous code
print(amount)
#return this in the console:
10
212
2
454
#this is not a list, in just result of for loop
so my question is: how can i have a list like [10, 212, 2, 454] ? i try to do
list = []
for i in arr_of_user_id:
list.append(amount)
print(list)
# return [10,10,10,10], so 4 time the same value
so how to put value of the 'for loop' in 1 list ?