码迷,mamicode.com
首页 >  
搜索关键字:init    ( 26732个结果
Python学习实践一
贪吃蛇小游戏 pycharm——pygame game.py import pygame # 导包 from game_items import * # 导类和变量 class Game(object): # 这里的object类,意为顶级/基础类。 def __init__(self): self ...
分类:编程语言   时间:2020-07-30 14:24:28    阅读次数:72
练习41:学着去说面向对象
一 词汇训练 类(class):告诉python创建一个新类型的东西。(Tell python to make a new type of thing). 对象(object):两种含义:最基本类型的东西,任何实例。(the most basic type of thing,and any inst ...
分类:其他好文   时间:2020-07-29 21:49:24    阅读次数:77
Gluttonous Snake.js
//面向对象开发//创建方格var sw=20, //小方格的宽 sh=20, //小方格的高 tr=30, //行数 td=30; //列数//蛇的实例 var snake = null,//食物的实例 food=null,//游戏的实例 game=null;// 构造函数// x 横坐标 y 纵 ...
分类:Web程序   时间:2020-07-29 21:42:16    阅读次数:78
python 通过文件夹导入包的操作
通过文件夹导入包要求每个目录下都有一个__init__.py文件,此文件可空白。也可不空。 a@ubuntu:~/Desktop$ tree myp myp ├── a │ ├── b.py │ └── __init__.py └── __init__.py 1 directory, 3 files ...
分类:编程语言   时间:2020-07-29 21:41:32    阅读次数:70
npm init初始化项目
npm init的作用 在node开发中使用npm init会生成一个pakeage.json文件, 这个文件主要是用来记录这个项目的详细信息的,它会将我们在项目开发中所要用到的包,以及项目的详细信息等记录在这个项目中。 方便在以后的版本迭代和项目移植的时候会更加的方便。 也是防止在后期的项目维护中 ...
分类:其他好文   时间:2020-07-29 21:40:42    阅读次数:112
129求根到叶子节点数字之和
class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = Nonea = TreeNode(1)b = TreeNode(2)c = TreeNode(3)a.left = ba.right = ...
分类:其他好文   时间:2020-07-29 21:25:43    阅读次数:70
02_对象和对象封装
# 1:什么是对象?class File: def read(self): print('读取文件内容')# F = File() # 实例化类# 1: 其中file就叫File()的对象,其实很好理解,还记得变量的# 关联关系吧,F变量名 和 File()变量值是关联关系所以通过F就# 可以调用c ...
分类:其他好文   时间:2020-07-29 15:27:36    阅读次数:102
AcWing 826. 单链表
AcWing 826. 单链表 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int e[N],ne[N],head,idx; //初始化 void init(){ head=-1; idx=0; } //将x插到 ...
分类:Windows程序   时间:2020-07-29 15:14:17    阅读次数:98
AcWing 827. 双链表
AcWing 827. 双链表 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int e[N],l[N],r[N],idx; void init(){ //0表示左端点,1表示右端点 r[0]=1; l[1]=0; ...
分类:Windows程序   时间:2020-07-29 15:12:48    阅读次数:86
AcWing 828. 模拟栈
AcWing 828. 模拟栈 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int stk[N],tt; void init(){ tt=0; } void add(int x){ stk[++tt]=x; } ...
分类:Windows程序   时间:2020-07-29 15:11:00    阅读次数:89
26732条   上一页 1 ... 61 62 63 64 65 ... 2674 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!