Off the top of my head I'm not sure if this is part of Markdown proper (or maybe GitHub's "flavor") but you can do fenced code blocks, like so:
~~~
// your code // goes here // and here
~~~
~~~
// your code // goes here // and here
~~~
```python
from functools import partial
def foo(a,b,i):
if i >= a and i <= b:
return i**2
else:
return 0
print reduce(lambda x,y: x+y,map(partial(foo,3,7),xrange(1,10)))
```