Skip to content

Instantly share code, notes, and snippets.

@yasith
Created September 24, 2013 16:27
Show Gist options
  • Save yasith/6687326 to your computer and use it in GitHub Desktop.
Save yasith/6687326 to your computer and use it in GitHub Desktop.
from raspberrypions import peon_task
def countAs(sequence):
num = 0
for char in sequence:
if char is 'A':
num += 1
return num
if __name__ == "__main__":
huge_string = "ABABABABABABABABAFKJHAKJHAKJAJACFGCYAGFAYCFJCFAJCAJA"
partA = huge_string[:len(huge_string)//2]
partB = huge_string[len(huge_string)//2:]
xA = peon_task(countAs, partA)
xB = peon_task(countAs, partB)
print xA + xB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment