1)
http://www.pythonchallenge.com/ 提供了不同level的Python題目,非常有趣的題目。做完一題后,把URL中的pc改為pcc可以看到上一題的答案
2)
http://projecteuler.net/ 里面有200多道題目,不要要求提交代碼,只要最終答案,提供用各種語言來解決問題。這里(
http://dcy.is-programmer.com/posts/8750.html)有部分題目的答案
非常好玩,有興趣的朋友,快來試試吧
看看 project euler 的第一道題:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
用 python 語言寫出來是:
print sum(i for i in xrange(1, 1000) if i % 3 == 0 or i % 5 == 0)