随笔分类 -  Python

python
Binary Search in Python
摘要:We can describe it like this:In computer science, abinary searchis an algorithm for locating the positionof an item in a sorted array.The idea is simple: compare the target to the middle item in the l... 阅读全文
posted @ 2010-08-10 18:19 oyzway 阅读(3395) 评论(0) 推荐(0) 编辑
Python Challenge - map.py
摘要:### what about making trans? ###Hint: K->M O->Q E->Geverybody thinks twice before solving this.g fmnc wms bgblr rpylqjyrc gr zw fylb.rfyrq ufyr amknsrcpq ypc dmp.bmgle gr gl zw fylbgq glcdd... 阅读全文
posted @ 2010-08-08 14:59 oyzway 阅读(1541) 评论(0) 推荐(0) 编辑
Python Challenge - 0.py
摘要:活动规则不细讲。我也不是很清楚,呵呵。网上大把。=.=### warming up ###Hint: try to change the URL address.###如标题所示,确实是热身题目。不过也向解题者显示了Python强大的地方:轻而易举地表示一个很大的整型。很简单是的东西,无需解释。直接上代码。在python shell中输入即可。[代码]输出:274877906944将浏览器地址栏中... 阅读全文
posted @ 2010-08-08 03:08 oyzway 阅读(1598) 评论(0) 推荐(0) 编辑
python:py2exe生成windows可执行文件
摘要:python学得好好的,在机子上跑得正欢,女朋友(人文专业)说:你学这个之后能有啥呢?弄点成品来看看。然后就让我编点东西送给她。东西是搞出来了,女朋友不高兴了。“这什么玩意嘛,我要的是直接能在我电脑上运行的东西!”= 。= Python确实方便,不过对于普通用户来说,她只需要能直接运行的东西,而不是要装个解释器什么的。查了资料,发现了py2exe。可将Python脚本编译成... 阅读全文
posted @ 2010-08-07 16:36 oyzway 阅读(3018) 评论(0) 推荐(0) 编辑
dive into python -- 笔记
摘要:Function:In fact, everyPythonfunction returns a value; if the function ever executes areturnstatement, it will return that value, otherwise it will returnNone, thePythonnull value.doc string Adoc string, if it exists, must be the first thing defined in a function (that is, the first thing after the 阅读全文
posted @ 2010-07-22 02:11 oyzway 阅读(754) 评论(0) 推荐(0) 编辑
关于Python中的for循环控制语句
摘要:#第一个:求 50 - 100 之间的质数import mathfor i in range(50, 100 + 1): for j in range(2, int(math.sqrt(i)) + 1): if i % j == 0: break else: print i#第二个:把else的位置与if处于同一缩进。import mathfor i in range(50, 100 +... 阅读全文
posted @ 2010-06-14 16:27 oyzway 阅读(537683) 评论(4) 推荐(3) 编辑
一些Python资源
摘要:'''python'''新来的?不知道Python能干什么?看看这里:'''作品展示-python吧:'''http://www.python8.org/a/zuopinzhanshi/知道了吧?那还不从头开始?看看这里:'''简明python教程:'''http://www.woodpecker.org.cn:9081/doc/abyteofpython_cn/chinese/index.html习惯看视频手把手学技术?也是一个习惯。看看这里: 阅读全文
posted @ 2010-05-30 22:20 oyzway 阅读(1497) 评论(3) 推荐(1) 编辑