统计

留言簿(1)

DB

Others

QA

Tech Website

阅读排行榜

评论排行榜

学习Python的好网站

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(11000if i % 3 == 0 or i % 5 == 0)

 


 

posted on 2011-06-17 20:26 XXXXXX 阅读(4365) 评论(2)  编辑  收藏 所属分类: Python

评论

# re: 学习Python的好网站 2011-06-17 23:10 eeee

http://www.pythonchallenge.com/ 我怎么没看到题目 ,进去以后就一个电视机样的页面,然后呢????  回复  更多评论   

# re: 学习Python的好网站 2011-06-17 23:32 步步为营

@eeee
把2^38结果作为URL后面的HTML文件名就可以了,呵呵,,看那个HINT  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航: