元组通过圆括号中用逗号分割的项目定义。元组通常用在使语句或用户定义的函数能够安全地采用一组值的时候,即被使用的元组的值不会改变。含有0个或1个项目的元组。一个空的元组由一对空的圆括号组成,如myempty = ()。然而,含有单个元素的元组就不那么简单了。你必须在第一个(唯一一个)项目后跟一个逗号,...
分类:
编程语言 时间:
2014-07-07 08:30:25
阅读次数:
211
#hello.pydef sayHello(): str="hello" print(str);if __name__ == "__main__": print ('This is main of module "hello.py"') sayHello()python作为一...
分类:
编程语言 时间:
2014-07-07 00:22:06
阅读次数:
262
题目:Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function...
分类:
其他好文 时间:
2014-07-07 00:14:37
阅读次数:
186
直接上代码吧#-*-coding:utf-8import osif os.path.exists('d:\\cpickle.data'): os.remove('d:\\cpickle.data')import cPickle as Pshoplist=['apple','banana','...
分类:
编程语言 时间:
2014-07-07 00:09:58
阅读次数:
475
1、操作符(1)成员关系操作符:in 、not in>>> string ='abcdefg'>>> 'a' in stringTrue>>> 'h' in stringFalse>>> 'h' not in stringTrue*补充知识*:string模块>>> import string>>>...
分类:
编程语言 时间:
2014-07-06 23:50:59
阅读次数:
394
>>> import thisThe Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is...
分类:
编程语言 时间:
2014-07-06 23:48:26
阅读次数:
303
遇到某需求,要求维护sm30的视图时,能加上排序按钮。【转自http://blog.csdn.net/tsj19881202/article/details/7517232】1. se11 点击修改,进入对应的表,然后点击“表格维护生成器”2.进入后,点击 环境-修改-用户界面3 点控制信息,创.....
分类:
其他好文 时间:
2014-07-06 23:42:37
阅读次数:
262
#-*-coding:utf-8class Person: __privateName=None; count=0;#既可以被实例对象引用,也可以被当做静态对象引用,NND,好混乱。 def __init__(self,name): self.count+=1 ...
分类:
编程语言 时间:
2014-07-06 23:36:44
阅读次数:
354
题目:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are given a target valu...
分类:
其他好文 时间:
2014-07-06 23:34:53
阅读次数:
273
继续在上一节的类的基础上测试继承:#-*-coding:utf-8import Syntax2class Student(Syntax2.Person): def __init__(self,name,age): Syntax2.Person.__init__(self,nam...
分类:
编程语言 时间:
2014-07-06 23:19:57
阅读次数:
310