I have this list
x = [1,2,3,4,5,6]
I would like to convert elements greater than 3 as 0 so the list would become [1,2,3,0,0,0]
Here is my code
for i in range(len(x)):
if x[i] > 3:
x = 0
I got this error message " 'int' object is not subscriptable"
. could somebody tell me what I did wrong