Last active
July 3, 2018 23:17
-
-
Save JL-Cox/e77d8f34e6b685c63e70236d77e3ea2b to your computer and use it in GitHub Desktop.
CodeWarsKata_FakeBinary_06272018
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 fake_bin(x): | |
print(x) | |
x = list(map(int, x)) | |
for i in range(len(x)): | |
if x[i] < 5: | |
x[i] = 0 | |
else: | |
x[i] = 1 | |
x = list(map(str,x)) | |
x = "".join(x) | |
print(x) | |
return x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment