?
Class
Inheritance: Single inheritance, multiple inheritance
Method: Start with self, similar to this in C #
Properties: Direct Write variables
Object: Using the class name () construct
__init__ (): constructor
?
#多继承 class ? A (object): ???? ............. class ? B (object): ???? ............. class ? C (A, b): ? ? Classrcdbase(object): ? RecordID = "" ? def __init__ (self): Print' call Rcd Base __init__ ' ? def Getrecordid (self): Return to self. RecordID ? Classrcdheader(rcdbase): def __init__ (self): Print' call Rcdheader __init__ ' ReturnSuper(rcdheader, self). __init__ () ? CreateDate = "" Createtime ="2015-8-6" Softwarename = "IMC" ? Header = rcdheader() Print header. Createtime Print header. Softwarename ? |
?
All non-class notation is literal .
The list literal is []
__ADD__ is actually an internal structure of operator overloading
Method of List
Print dir (list) #print Help (list) NL = [1,3,5,7] Nl.append (' PZ ') Print nl.append (3), NL Print Nl.count (3) Print nl.index (' PZ ') Print Nl.insert (0,12), NL Print Nl.pop (2) Print nl,nl.pop () Print nl.reverse (), NL Print Nl.sort (), NL ? Print [+] + [5,6,9] |
?
Python Learning Note 05