Q:

How to remove a whitespace from a string

What I want my code to do is that eventually the "-" will collide with the "0". But right now all it does is keep chasing the "0" and never touch it.  
import time
global gunshot, gun
gun = 0
gunshot = "-           0"

while True:
    global gunshot
    gunshot = " " + gunshot
    gunshot.replace(' 0', '0')
    print ('\r {0}'.format(gunshot)),
    if gunshot.find("-0") == 1:
        gunshot = "-"
    time.sleep(.1)

That is want I want:
     -     0
      -    0
       -   0

This is what it is doing
     -     0
     -     0
     -     0

A:

replace returns a new string, it does not change the variable inplace.
gunshot = gunshot.replace(' 0', '0')

This will fix your immediate problem, but you should consider using @MSeiferts code because it is much better.

