码迷,mamicode.com
首页 >  
搜索关键字:dict    ( 5061个结果
python面试题
1:Python如何实现单例模式? Python有两种方式可以实现单例模式,下面两个例子使用了不同的方式实现单例模式: 1. class Singleton(type): def __init__(cls, name, bases, dict): super(Singleton, cls).__in ...
分类:编程语言   时间:2017-01-21 11:52:33    阅读次数:340
C#各版本新特性
转 C# 2.0 泛型(Generics) 泛型是CLR 2.0中引入的最重要的新特性,使得可以在类、方法中对使用的类型进行参数化。 例如,这里定义了一个泛型类: class MyCollection<T> { T variable1; private void Add(T param){ } } ...
分类:Windows程序   时间:2017-01-20 18:02:27    阅读次数:318
python (2) 字典
一。字典的特性。: (1). python 字典是无序的。(而列表有序) 我们可以把字典理解为一组 key:value 这样的健值对。 (2). python字典的key是唯一的。 (3). 字典可以嵌套字典,嵌套列表。 eg:定义一个字典。对字典进行基本操作。 1 >>> dict = { 2 . ...
分类:编程语言   时间:2017-01-20 15:51:23    阅读次数:244
python中将两个list合并为字典
两个list合并为字典的代码如下: ...
分类:编程语言   时间:2017-01-19 21:17:15    阅读次数:222
Python-功能函数的使用(二)
使用可选参数定义函数 可选参数可以通过分配(用定义=)的默认值的参数名: 可以通过3种不同的方式调用此函数: 警告 可变类型(list,dict,set等),应小心时,给出被视为默认属性。默认参数的任何突变将永久更改。 Lambda(内联/匿名)函数 该lambda关键字创建一个包含一个表达式的内联 ...
分类:编程语言   时间:2017-01-19 18:15:55    阅读次数:135
collection 类
collection 类 dic=collections.OrderedDict()//有序字典 //dic=dict() dic['k1']='v1' dic['k2']='v2' dic['k3']='v3' print(dic) dic.move_to_end('k1')//把第一个移到最后 ...
分类:其他好文   时间:2017-01-19 12:12:08    阅读次数:170
python 基础干货 02
list 与 tuple list 类似 数组 tuple 跟 list 一样, 只是一旦定义, 里边的内容不可以改变. 这样, 上边的内容就不可以改变了. "可变的" tuple, 不是说 tuple 是不可以改变的么? 想内存 dict 与 set dict 是 python内置字典, 其他语言 ...
分类:编程语言   时间:2017-01-18 13:46:15    阅读次数:271
高级C#信使(译) - Unity维基百科
高级C#信使 作者:Ilya Suzdalnitski 译自:http://wiki.unity3d.com/index.php/Advanced_CSharp_Messenger 描述 前言 MissingReferenceException的原因和解决方案 信使 用法 事件监听器 注册事件监听器 ...
分类:编程语言   时间:2017-01-17 21:35:35    阅读次数:324
JSON Web Token in ASP.NET Web API 2 using Owin
In the previous post Decouple OWIN Authorization Server from Resource Server we saw how we can separate the Authorization Server and the Resource Serv ...
分类:Windows程序   时间:2017-01-17 21:27:01    阅读次数:925
Inversion of Control Containers and the Dependency Injection pattern--Martin Fowler
原文地址:https://martinfowler.com/articles/injection.html n the Java community there's been a rush of lightweight containers that help to assemble compone ...
分类:其他好文   时间:2017-01-17 10:53:12    阅读次数:203
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!