Browse Source

Create Fake Binary.py

PythonCoder8 3 years ago
parent
commit
a68eafeb8f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      8 kyu/Fake Binary/Fake Binary.py

+ 8 - 0
8 kyu/Fake Binary/Fake Binary.py

@@ -0,0 +1,8 @@
+def fake_bin(x):
+    result = ''
+    for i in x:
+        if int(i) < 5:
+            result += '0'
+        if int(i) >= 5:
+            result += '1'
+    return result