Say I have an array of thousands of colours:
x=[blue, red, green,...]
How do I delete the last character(s) of each string so x1 would be [blu, re, gree,...]
I tried this:
x1=[]
for i in range (0,len(x)):
x1[i]=x[i:-1]
The error I get is: list assignment index out of range
Any idea how to do this?