活到老学到老  

记录遇到问题的点点滴滴。

0

#coding:utf-8 #特殊说明 #if/elif/else开头的行需要用冒号:结束 #if/elif/else行下面的表达式必须至少有一个空格的缩进,表明这条语句属于if语句的一部分 #elif语句的数量没限制 #但是,如果是空语句,需要增加pass,否则会报错 x = raw_input('Please input some...

7年前发布  · 736 次阅读
0

Python的逻辑操作有三种:and、or、not。分别对应与、或、非。举例:#coding:utf-8 test1 = 12 test2 = 0 print (test1 > test2) and (test1 > 14) #result = False print (test1 < test2) or (te...

7年前发布  · 884 次阅读
0

#coding:utf-8 #布尔表达式的值只有两个,True和False x = 12.4 y = 12.3 print x==y #符号'=='用于判断两个数是否相等,这条语句的result=False x= 12.3 print x == y #这条语句的result = True print x != y #符号'!='...

7年前发布  · 836 次阅读
0

一、int函数能够     (1)把符合数学格式的数字型字符串转换成整数     (2)把浮点数转换成整数,但是只是简单的取整,而非四舍五入。举例:aa = int("124") #Correct print "aa = ", aa #result=124 bb = int(123.45) #correct print "b...

7年前发布  · 1034 次阅读
0

去空格及特殊符号s.strip().lstrip().rstrip(',')复制字符串#strcpy(sStr1,sStr2) sStr1 = 'strcpy' sStr2 = sStr1 sStr1 = 'strcpy2' print sStr2连接字符串#strcat(sStr1,sStr2) sStr1 = 'strcat' sSt...

7年前发布  · 1286 次阅读
0

python安装完毕后,提示找不到ssl模块:[root@localhost ~]# python2.7.5Python 2.7.5 (default, Jun 3 2013, 11:08:43) [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2Type "help", "copyrigh...

7年前发布  · 759 次阅读