摘要:
pass 阅读全文
摘要:
#代码说明def aFunc_1(): passclass Myclass(object): a_arg = arg1 def __init__(sefl, *args, **kwargs): self.another_arg = args[] def afunc_2(self): print self.another_arg @classmethod def aFunc_3(cls): print "class method" @staticmethod def... 阅读全文
摘要:
pass 阅读全文
摘要:
1、从字典中取值:1 mydict = {"key" : "value"}2 #使用get方法3 val = mydict.get("key")4 # val --> 'value'1 mydict.get("if_key_not_in_dict", "default value")2 #--> 'default value'3 #并没有改变原dict4 #mydict --> {"key":"value" 阅读全文