Problem 30
Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:
1634 = 14 + 64 + 34 + 44
8208 = 84 + 24 + 04 + 84
9474 = 94 + 44 + 74 + 44...
分类:
其他好文 时间:
2014-08-21 09:48:04
阅读次数:
251
当初学 Python 时,想要弄懂 Python 的错误信息的含义可能有点复杂。这里列出了常见的的一些让你程序 crash 的运行时错误。1)忘记在if,elif,else,for,while,class,def声明末尾添加 :(导致 “SyntaxError :invalid syntax”)该错...
分类:
编程语言 时间:
2014-08-21 09:45:53
阅读次数:
269
To 十进制二进制: >>> int('110', 2) -> 6八进制: >>> int('10', 8) -> 8十六进制: >>> int('10', 16) -> 16 >>> int('1A', 16) -> 26To 十六进制:十进制: >>>hex(12) -> ‘0xc’二进制: >...
分类:
编程语言 时间:
2014-08-21 09:34:23
阅读次数:
280
Problem 29
Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
22=4, 23=8, 24=16, 25=32
32=9, 33=27, 34=81, 35=243
42=16, 43=64, 44=256, 45=1024
52=25, 53=125, 54=625, 55=312...
分类:
其他好文 时间:
2014-08-21 08:26:53
阅读次数:
177
早就听说gevent基于事件的异步处理能力 效率多么,一致z...
分类:
其他好文 时间:
2014-08-21 01:39:03
阅读次数:
250
由于单位设计数据库表·,都用sql.不知道什么原因不用 powerdesign或者ermaster工具,建表很痛苦 作为程序猿当然要想办法解决,用Python写一个程序解决需要用到 xlrd linux下 sudo pip install xlrd主要是适用于db2数据库excel 表结构 其中 n...
分类:
数据库 时间:
2014-08-21 01:35:33
阅读次数:
509
1.在Python中如何操作文件2.如何读取大文件文件内建函数:open(file_name,access_mode=‘r‘,buffering=-1),file()文件访问模式:r:以读方式打开(默认)w:写a:追加b:以二进制方式打开r+w+a+:读写方式打开rb:以二进制读模式打开wb:以二进制写模式打开ab:以二进制追加模式打开输入..
分类:
编程语言 时间:
2014-08-21 00:23:13
阅读次数:
166
《简明Python编程》核心笔记(1~5章)...
分类:
编程语言 时间:
2014-08-21 00:18:03
阅读次数:
278
测试一个对象是否是类字符串任务 有时候需要测试一个对象,尤其是当你在写一个函数或者方法的时候,经常需要测试传入的参数是否是一个字符串。解决方案 利用内建的isinstance 和basestring 来简单快速地查询某个对象是否是字符串或者是Unicode 对象方法,如下: 代码: >>> ...
分类:
编程语言 时间:
2014-08-21 00:06:53
阅读次数:
196
Download Setuptools and pipYou can downloadpipfromgithubSetuptoolsfrombitbucketAnd confirm this aren’t harmful.Open ConsoleAs an Admin, just open cons...