Created
August 17, 2020 18:02
-
-
Save les-peters/e6b614f6ecad8367b4b9a0bb73e52c39 to your computer and use it in GitHub Desktop.
Cassidoo 2020-08-17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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