Post your source code in WordPress.com

Try to post some source code in WordPress.com. It’s easy to do this.
Specify what language you like. It also could mark some lines to be highlight.

[code language="python" highlight="7,8" title="Show me the Prime!"]
Put your source code here.
[/code]

See the following result below.

import sys
import math

max_num = int(sys.argv[1])
check_value = int(math.sqrt(max_num)) + 1

noprime = sorted(list(set([j for i in range(2, check_value) for j in range(2*i, max_num+1, i)])))
prime = [x for x in range(2, max_num+1) if x not in noprime]

print prime

Reference here:
http://en.support.wordpress.com/code/posting-source-code/

廣告

發表迴響

Please log in using one of these methods to post your comment:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s