码迷,mamicode.com
首页 >  
搜索关键字:def    ( 28626个结果
UVA 1388 Graveyard
不能颓了,好好学习,天天向上Orz! emmmmm,总感觉……好神奇啊,自己写了好长的代码还WA了,“真”代码果然够简介, 虽然大佬眼中的水题我也想不到……见得多了说不定会想到2333333 //QAQ神奇啊,把原来的雕塑先看为长度为n的数轴,再把n映射到m+n的数轴上//然后就直接找当前坐标最近的 ...
分类:其他好文   时间:2017-09-18 22:32:03    阅读次数:214
我与前端之间不得不说的三天两夜之html基础
HTML 初识<!--more--> 分类 cs模式 client-server bs模式 Browser-server web服务本质 from socket import * def main(): service=socket(AF_INET,SOCK_STREAM) service.bind ...
分类:Web程序   时间:2017-09-18 22:19:11    阅读次数:244
Contains Duplicate II
这道题为简单题 题目: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums ...
分类:其他好文   时间:2017-09-18 22:11:56    阅读次数:201
Django-views,用户认证,login_requierd()
分别是认证,登入,注销的功能 authenticated():验证是否登录 login():登入,并且创建cookie,session logout():注销,清除session user对象方法 user对象的is_authenticated()方法 创建用户方法 修改密码 示例一:修改密码 @l ...
分类:其他好文   时间:2017-09-18 20:35:56    阅读次数:176
class Inheritance
Python Inheritance Syntax example: super().__init__(3) is equivalent to Polygon.__init__(self,3) super(Class,obj) .func--> calling func in base class! ...
分类:其他好文   时间:2017-09-18 19:47:56    阅读次数:184
Python Day24
一、复习: 二、面向对象3: 1.继承: 使用非绑定的类方法(用类名来引用的方法),并在参数列表中,引入待绑定的对象(self),从而达到调用父类的目的。 这样做的缺点是,当一个子类的父类发生变化时(如类B的父类由A变为C时),必须遍历整个类定义,把所有的通过非绑定的方法的类名全部替换过来,例如代码 ...
分类:编程语言   时间:2017-09-18 19:46:15    阅读次数:182
ddd
class Tree: def __init__(self,name,sort): self.name = name self.sort = sort self.children = {} def create(self,node_map,edge): l,r,k = edge l_node = n ...
分类:其他好文   时间:2017-09-18 19:44:50    阅读次数:173
Django_Form表单补充
Form表单 问题1: 注册页面输入为空,报错:keyError:找不到password def clean(self): print(" ",self.cleaned_data) # if self.cleaned_data["password"]==self.cleaned_data["repe ...
分类:其他好文   时间:2017-09-18 19:43:15    阅读次数:142
CODEVS——T 1049 棋盘染色
http://codevs.cn/problem/1049/ 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 查看运行结果 http://codevs.cn/problem/1049/ 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 G ...
分类:其他好文   时间:2017-09-18 18:25:55    阅读次数:288
python装饰器执行机制
前沿: 首先是看到了单例模型,想不明白 outer中的参数 为什么能像 global的参数 一样屹立不倒。 #单例模型 def single_model(cls): instance = {} def inner(*args, **kwargs): print if cls not in insta ...
分类:编程语言   时间:2017-09-18 17:20:40    阅读次数:180
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!