Created
October 2, 2014 14:06
-
-
Save mvallebr/08117f1bb6decc9a5cc5 to your computer and use it in GitHub Desktop.
numeros.py
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
import sys | |
convert = {1:0, 2:1, 3:1, 4:0, 5:1, 6:0, 7:1, 8:0, 9:0, 0:0} | |
a = [1,2,3,4,5,6,7,8,9,0] | |
print "Original array", str(a) | |
print "Converted array", | |
itera = (convert[key] for key in a) | |
for v in itera: | |
sys.stdout.write('%d' % v) | |
print '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment