摘要: 字符串格式化符号格式化字符 转换方式%c 转换成字符(ASCII码值,或者长度为一的字符串)%r 优先用repr()函数进行字符串转换%s 优先用str()函数进行字符串转换%d/%i 转成有符号十进制数%u 转成无符号十进制数%o 转成无符号八进制数%x/%X (Unsigned)转成无符号十六进... 阅读全文
posted @ 2015-09-15 11:50 Godiness 阅读(747) 评论(0) 推荐(0) 编辑
摘要: 5-8Geometryimport mathdef sqcube(): s = float(raw_input('enter length of one side: ')) print 'the area is:', s ** 2., '(units squared)' print 'the ... 阅读全文
posted @ 2015-09-15 10:39 Godiness 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 1.简介默认,浮点数学缺乏精确性decimal模块提供了一个Decimal数据类型用于浮点数计算。相比内置的二进制浮点数实现float这个类型有助于金融应用和其它需要精确十进制表达的场合,控制精度,控制舍入以适应法律或者规定要求,确保十进制数位精度,或者用户希望计算结果与手算相符的场合。Decima... 阅读全文
posted @ 2015-09-15 10:09 Godiness 阅读(1880) 评论(0) 推荐(0) 编辑
摘要: random1.简介random是用于生成随机数,我们可以利用它随机生成数字或者选择字符串>>>importrandom>>>dir(random)['BPF','LOG4','NV_MAGICCONST','RECIP_BPF','Random','SG_MAGICCONST','SystemRa... 阅读全文
posted @ 2015-09-15 09:45 Godiness 阅读(2544) 评论(0) 推荐(0) 编辑
摘要: 1.math简介>>>importmath>>>dir(math)#这句可查看所有函数名列表['__doc__','__name__','__package__','acos','acosh','asin','asinh','atan','atan2','atanh','ceil','copysig... 阅读全文
posted @ 2015-09-14 22:00 Godiness 阅读(789) 评论(0) 推荐(0) 编辑
摘要: 4-1Python objects All Python objects have three attributes:type,ID,and value. All are readonly with a possible expection of the value(which can be c... 阅读全文
posted @ 2015-09-14 20:31 Godiness 阅读(553) 评论(0) 推荐(0) 编辑
摘要: 3-4Statements Ues ;3-5Statements Use\(unless part of a comma-separated sequence in which case \ is optional) 阅读全文
posted @ 2015-09-14 19:59 Godiness 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 2-5 Loops and Numbers a) i = 0 while i 0: print 'positive' else: print 'zero'2-7 Loops and strings s = raw_input('enter a string:') for ... 阅读全文
posted @ 2015-09-14 19:48 Godiness 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 1.1文件对象文件只是连续的字节序列。数据的传输经常会用到字节流,无论字节流是由单个字节还是大块数据组成.1.2文件内建函数open()和file() 内建函数open()的基本语法是: file_object=open(file_name,access_mode='r',buffering=-1)... 阅读全文
posted @ 2015-09-14 18:03 Godiness 阅读(8574) 评论(0) 推荐(0) 编辑
摘要: 1、进入win102、下载EasyBCD,360软件管家里面有,version=2.23、启动软件,工具箱里面选择“BCD部署”→MBR配置选项中选“在MBR中安装Windows Vista/7的bootloader”→点击编写MBR4、右键“此电脑”→管理→管理磁盘→删除ubuntu所在分区→新建... 阅读全文
posted @ 2015-09-12 14:46 Godiness 阅读(2097) 评论(0) 推荐(0) 编辑