码迷,mamicode.com
首页 >  
搜索关键字:tuple    ( 3184个结果
LeetCode 447 Number of Boomerangs
Problem: Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand  ...
分类:其他好文   时间:2016-11-15 14:14:42    阅读次数:210
python基础(一)
一.第一个python程序 1.交互式编程 直接在命令行里面输入python即可进入python交互式命令行,linux下一样: 在 python 提示符中输入以下文本信息,然后按 Enter 键查看运行效果: 2.脚本式编程 把代码都写到文件里面,然后运行文件,以.py结尾的就是python文件, ...
分类:编程语言   时间:2016-11-15 07:48:55    阅读次数:200
[LeetCode]447 Number of Boomerangs
Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand j equals ...
分类:其他好文   时间:2016-11-13 11:30:13    阅读次数:203
Python中内置数据类型list,tuple,dict,set的区别和用法
Python中内置数据类型list,tuple,dict,set的区别和用法 Python语言简洁明了,可以用较少的代码实现同样的功能。这其中Python的四个内置数据类型功不可没,他们即是list, tuple, dict, set。这里对他们进行一个简明的总结。 List 字面意思就是一个集合, ...
分类:编程语言   时间:2016-11-12 13:41:53    阅读次数:208
python的重重之器(生成器、迭代器、装饰器)
一、装饰器 1、定义:本质是函数,装饰其他函数就是为其他函数添加附件功能。 2、原则: a.不能修改被装饰的函数的源代码; b.不能修改被装饰的函数的调用方式; 实例: 3、实现装饰器的知识储备: a.函数即“变量” b.高阶函数 b1.把一个函数名当做实参传递给另外一个函数(在不修改被装饰函数的前 ...
分类:编程语言   时间:2016-11-12 07:50:36    阅读次数:216
[LeetCode] Number of Boomerangs
Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals ...
分类:其他好文   时间:2016-11-10 03:16:24    阅读次数:184
python迭代器实现斐波拉契求值
斐波纳契数列以递归的方法定义:F(0)=0,F(1)=1,F(n)=F(n-1)+F(n-2)(n≥2,n∈N*)。这个数列从第2项开始,每一项都等于前两项之和,而且当n趋向于无穷大时,前一项与后一项的比值越来越逼近黄金分割0.618。 用dir(list),dir(tuple),dir(file) ...
分类:编程语言   时间:2016-11-09 10:59:02    阅读次数:183
Storm序列化
序列化 本文阐述了 Storm 0.6.0 以上版本的序列化机制。在低于 0.6.0 版本的 Storm 中使用了另一种序列化系统,详细信息可以参考 Serialization (prior to 0.6.0) 一文。Storm 中的 tuple 可以包含任何类型的对象。由于 Storm 是一个分布 ...
分类:其他好文   时间:2016-11-05 02:27:17    阅读次数:216
Python中的数据类型
原文链接:http://www.datastudy.cc/to/88 Python中总共有六种数据类型,分别如下: 数字(Numbers) 字符串(String) 列表(List) 元组(Tuple) 集合(Sets) 字典(Dictionaries) 数字的种类: 整数型(int) 浮点型(float) 布尔型(bool) 负数型(complex..
分类:编程语言   时间:2016-11-04 18:01:40    阅读次数:216
通过参数传递,判断数字、字符串、list、tuple、词典等数据类型是否为可变数据对象。
#!/usr/bin/python #coding=utf-8 __author__=‘moxiaokai‘ #通过参数传递,判断数字、字符串、list、tuple、词典等数据类型是否为可变数据对象 a=2 b=‘啊哈‘ c=[1,2,3] d=(1,2,3) e={‘tom‘:11,‘sam‘:57,‘lily‘:100} defnum(x):#数字 x=100 printx num(a) printa defstr(x):#字..
分类:其他好文   时间:2016-11-04 17:29:06    阅读次数:143
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!