Skip to content

Instantly share code, notes, and snippets.

@les-peters
Created August 17, 2020 18:02
Show Gist options
  • Save les-peters/e6b614f6ecad8367b4b9a0bb73e52c39 to your computer and use it in GitHub Desktop.
Save les-peters/e6b614f6ecad8367b4b9a0bb73e52c39 to your computer and use it in GitHub Desktop.
Cassidoo 2020-08-17
def moveZeros(a):
a = [1, 2, 0, 1, 0, 0, 3, 6]
b = []
c = []
for i in a:
if i:
b.append(i)
else:
c.append(i)
d = b + c
return(d)
print(moveZeros([1, 2, 0, 1, 0, 0, 3, 6]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment