码迷,mamicode.com
首页 >  
搜索关键字:range    ( 9515个结果
1337. 方阵中战斗力最弱的 K 行
class Solution(object): def kWeakestRows(self, mat, k): """ :type mat: List[List[int]] :type k: int :rtype: List[int] """ power = [sum(line) for line ...
分类:其他好文   时间:2020-06-08 14:49:39    阅读次数:59
441. 排列硬币
class Solution(object): def arrangeCoins(self, n): """ :type n: int :rtype: int """ return int(2 ** 0.5 * (n + 1 / 8) ** 0.5 - 1 / 2) if __name__ == ' ...
分类:其他好文   时间:2020-06-08 14:38:44    阅读次数:59
Python_接口设计
一,接口设计 使用polygon函数来画一个50边形,来接近一个圆。写circle这个函数了,需要半径r作为一个参数: $ cat circle.py #!/bin/bash import math def circle(t, r): circumference = 2 * math.pi * r ...
分类:编程语言   时间:2020-06-08 12:55:46    阅读次数:86
Redis中设置过期实践key
Redis的每个Key都可以设置一个过期时间,当达到过期时间的时候,这个key就会被自动删除。 ...
分类:其他好文   时间:2020-06-08 12:28:50    阅读次数:58
Excel VBA Chart 刻度 Axis.DisplayUnit
With Sheets("Report").ChartObjects.Add(...) .Chart.Axes(xlCategory).MinimumScale = RoundTo50(Sheets(sheetName).Range("M4")) .Chart.Axes(xlCategory).Ma ...
分类:编程语言   时间:2020-06-07 21:45:16    阅读次数:115
Java-Python对垒之质数计算
@ Java 实现 class PrimeNumber{ public static void main(String[] args) { long start=System.currentTimeMillis(); int count=0; label:for(int i=1;i<=100000; ...
分类:编程语言   时间:2020-06-07 19:32:18    阅读次数:59
int 和 Integer 有什么区别?
Java 是一个近乎纯洁的面向对象编程语言,但是为了编程的方便还是引入了基本 数据类型,但是为了能够将这些基本数据类型当成对象操作,Java 为每一个基本 数据类型都引入了对应的包装类型(wrapper class),int 的包装类就是 Integer, 从 Java 5 开始引入了自动装箱/拆箱 ...
分类:其他好文   时间:2020-06-07 16:43:40    阅读次数:84
python 零散知识点(列表和字典推导式)
列表推导式 A = [i for i in range(0,10)] B = [ i**2 for i in A] 字典推导式 for k,v in zip(['a','b','c','d'],[1,2,3,4]): print(k,v) d = { key:value for (key,value ...
分类:编程语言   时间:2020-06-07 16:22:12    阅读次数:60
进度条模块之tqdm
导入模块 from tqdm import tqdm import time ''' desc 描述 ncols 进度条总长度 可修改 range(1000) 封装迭代器 ''' for i in tqdm(range(1000),ncols=100,desc='商品进度加载'): time.sle ...
分类:其他好文   时间:2020-06-07 14:43:25    阅读次数:49
十进制转换为其他进制(不使用format)
base = [str(x) for x in range(10)] + [chr(x) for x in range(ord('A'), ord('A') + 6)] # ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C ...
分类:其他好文   时间:2020-06-07 13:15:30    阅读次数:85
9515条   上一页 1 ... 53 54 55 56 57 ... 952 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!