码迷,mamicode.com
首页 >  
搜索关键字:range    ( 9515个结果
输入一个正整数,按照从小到大的顺序输出它的所有质因子(如180的质因子为2 2 3 3 5 )
def count_factors(): n = int(input('input the num:')) num = n res = [] while n > 1: for i in range(2, n+1): if n % i == 0: n = int(n/i) res.append(i) ...
分类:其他好文   时间:2020-06-28 20:47:41    阅读次数:250
循环语句
1.while循环 2.while嵌套 3.for循环遍历 4.for循环结合range使用 5.break和continue 6.循环语句结合else语句使用 ...
分类:其他好文   时间:2020-06-28 18:48:38    阅读次数:43
Linux远程管理常用命令
目标 关机/重启 shutdown 查看或配置网卡信息 ifconfig ping 远程登录和复制文件 ssh scp 01. 关机/重启 序号命令对应英文作用 01 shutdown 选项 时间 shutdown 关机/重新启动 1.1 shutdown shutdown 命令可以 安全 关闭 或 ...
分类:系统相关   时间:2020-06-27 11:46:39    阅读次数:73
0303. Range Sum Query - Immutable (E)
Range Sum Query - Immutable (E) 题目 Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Give ...
分类:其他好文   时间:2020-06-27 09:44:58    阅读次数:46
0304. Range Sum Query 2D - Immutable (M)
恢复内容开始 Range Sum Query 2D - Immutable (M) 题目 Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left cor ...
分类:其他好文   时间:2020-06-27 09:36:59    阅读次数:61
yield关键字的使用
'''yield关键字的使用:yield关键字:yield < > 生成器生成器是一个不断产生值的函数yield语句的函数就是一个生成器生成器每次产生一个值(yield语句),函数被冻结,被唤醒后再产生一个值。为何要有生成器?生成器相比一次列出所有内容的优势 1、更节省存储空间 2、响应更迅速 3、 ...
分类:其他好文   时间:2020-06-27 09:29:12    阅读次数:58
数据结构与算法
import time start_time=time.time() for a in range(0,1001): for b in range(0,1001): c=1000-a-b if a**2+b**2==c**2: print("a,b,c:%d,%d,%d"%(a,b,c)) end_ ...
分类:编程语言   时间:2020-06-26 20:34:18    阅读次数:58
python之 loading进度条加载,和倒计时
import timeprint(' Loading ')for i in range(0,101): print('\r',f'当前进度{i}%',end='',flush=True) time.sleep(0.1)print(' 上课倒计时 ')for i in range(100,-1,-1) ...
分类:编程语言   时间:2020-06-26 18:37:45    阅读次数:86
Python爬虫+可视化图形库Pyecharts
源码: from pyecharts import Bar import re import requests num=0 b=[] for i in range(1,11): link='https://www.cnblogs.com/echoDetected/default.html?page= ...
分类:编程语言   时间:2020-06-26 18:08:35    阅读次数:95
剑指Offer:面试题07.重建二叉树
1.要点二叉树遍历重复在查找中查找某个数时(重复+查找=二重循环),应考虑是否可以用map2.题目输入某二叉树的前序遍历和中序遍历的结果,请重建该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。3.示例给出前序遍历 preorder =[3,9,20,15,7]中序遍历 inorder... ...
分类:其他好文   时间:2020-06-26 16:49:59    阅读次数:54
9515条   上一页 1 ... 45 46 47 48 49 ... 952 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!