Skip to content

Instantly share code, notes, and snippets.

@erkobridee
Created February 3, 2012 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erkobridee/1729957 to your computer and use it in GitHub Desktop.
Save erkobridee/1729957 to your computer and use it in GitHub Desktop.
um dos desafios do site rankk.org
def binaryStringCalc(strValue):
result = 0
for v in strValue.split(' + '):
result += int(v,2)
return str(bin(result)).split('0b')[1]
print binaryStringCalc('110000001 + 100111001 + 100101000 + 10000011 + 111010001')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment