I'm trying to make an "x" character move through a list, from one index to the other one and then returning over and over again. I want to know if it's possible to make it constant, so that in the Python shell I can see only one list with a moving x.
I've tried doing it with this code, but I'm pretty sure there must be other way to do it.
Sorry for my identation, I'm new and don't understand much.
Would love your help, thanks.
def vec ():
vec=[]
z=0
x="x"
e=" "
y=1
while (x=="x"):
while (y<=98):
vec[z]= e
z=z+1
vec[y]=x
y=y+1
vec[y]= e
w=98
m=99
while (m>0):
vec[m]= e
vec[w]= x
w=w-1
m=m-1