码迷,mamicode.com
首页 >  
搜索关键字:self    ( 14215个结果
leetcode 每日一题 63. 不同路径 II
动态规划 思路: 参考62. 不同路径 代码: class Solution: def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int: m = len(obstacleGrid) n = len(obstac ...
分类:其他好文   时间:2020-06-07 15:05:47    阅读次数:65
python面向对象(一)
1.面向对象思维,关于self的认识 (1)类的基本形式: class 类名: def 方法: pass 实例: # 基本格式,类中的方法与函数类似,但是参数中多了self参数 class boj: def mot(self,arg): print(self,arg) pass boj().mot( ...
分类:编程语言   时间:2020-06-07 12:34:53    阅读次数:63
【LeetCode每日一题】2020.6.4 238. 除自身以外数组的乘积
238. 除自身以外数组的乘积 给你一个长度为 n 的整数数组 nums,其中 n > 1,返回输出数组 output ,其中 output[i] 等于 nums 中除 nums[i] 之外其余各元素的乘积。 示例: 输入: [1,2,3,4] 输出: [24,12,8,6] 说明: 请**不要使用 ...
分类:编程语言   时间:2020-06-07 10:37:09    阅读次数:49
django框架——十一
今日内容概要 forms组件 cookie与session django中间件 目前可以说是所有web框架里面写的最好的 csrf跨站请求伪造 视图函数(CBV)如何添加装饰器 forms组件源码 """ 切入点: form_obj.is_valid() """ def is_valid(self) ...
分类:其他好文   时间:2020-06-06 22:00:28    阅读次数:78
线程-Thread类
threading-Thread类 方法与multiprocessing中基本一致 线程创建 Thread类创建 from threading import Thread import time def sayhi(name): time.sleep(2) print('%s say hello' ...
分类:编程语言   时间:2020-06-06 21:42:39    阅读次数:76
leetcode 每日一题 62. 不同路径
找规律 思路: 由题意可知,由于只能向下或向右移动,所以总共只需要走(m-1)+(n-1)= m+n-2步。而只需要确定m-1步向右的步数或者确定向下的n-1步,即可确定路径,所以共有或者种可能。 代码: class Solution: def uniquePaths(self, m: int, n ...
分类:其他好文   时间:2020-06-06 15:37:59    阅读次数:68
python中的global
https://blog.csdn.net/weixin_40894921/article/details/88528159 1.全局 从上面给的例子中可以看出,它可以被用来全局的 2.类内部函数的内部 class A: def f(self): a=2 def ff(): a=5#这里是无法改变a ...
分类:编程语言   时间:2020-06-06 10:36:36    阅读次数:67
web.py 中的分页设计
1、定义分页类 class Pagination(object): ''' 分页类 参数: per_page:每页数量 total_data:总数目 cur_page:当前页。 用法:(flask,html中自定义css) py: page = int(request.args.get("page" ...
分类:Web程序   时间:2020-06-06 01:06:26    阅读次数:65
PAT.1066 Root of AVL Tree(平衡树模板题)
1066 Root of AVL Tree (25分) An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node diff ...
分类:其他好文   时间:2020-06-05 23:18:28    阅读次数:73
forms组件、cookie与session、视图函数(CBV)如何添加装饰器
* forms组件* cookie与session* 视图函数(CBV)如何添加装饰器### forms组件源码```python"""切入点: form_obj.is_valid()"""def is_valid(self): """ Returns True if the form has no ...
分类:其他好文   时间:2020-06-05 22:56:41    阅读次数:83
14215条   上一页 1 ... 63 64 65 66 67 ... 1422 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!