码迷,mamicode.com
首页 >  
搜索关键字:self this    ( 14215个结果
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
Transformer 结构分析
self-attetion 1. 输入 \[ X = EmbeddingLookup(X) + PositionalEncoding \\ X.shape == (batch\_size, seq\_len, embedding\_dim) \] 2. 计算Q,K,V \[ Q = Linear(X ...
分类:其他好文   时间:2020-07-30 01:46:15    阅读次数:87
130被围绕的区域
from typing import List# 这道题看了大佬写的代码,经过自己的理解写出来了。# 从最外围的四周找有没有为O的,如果有的话就进入深搜函数,然后深搜遍历# 判断上下左右的位置是否为Oclass Solution: def solve(self, board: List[List[s ...
分类:其他好文   时间:2020-07-29 21:52:19    阅读次数:71
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
VueCli路由配置
import Vue from 'vue' import Router from 'vue-router' Router.prototype.go = function(t) { this.isBack = true console.log('go ' + this.history.current. ...
分类:其他好文   时间:2020-07-29 10:29:00    阅读次数:83
python 类与对象
类的成员实例变量实例变量就是对象个体特有的“数据”。#定义类classDog:def__init__(self,name,age):self.name=name#创建和初始化实例变量nameself.age=age#创建和初始化实例变量age#实例化对象dog=Dog(‘球球‘,2)#对实例变量通过“对象.实例变量”形式访问print(‘这是我家的狗,名字是%s,现在%d岁了!‘%(dog.nam
分类:编程语言   时间:2020-07-28 22:09:04    阅读次数:67
python+selenium 获取table列表中所有数据条数
# 定位到table,并获得table中所有得tr元素 menu_table = self.driver.find_element_by_xpath("//div[@class='datagrid-view1']/div[2]/div/table") rows = menu_table.find_e ...
分类:编程语言   时间:2020-07-28 17:25:27    阅读次数:137
Leetcode.283 | Move Zeroes(Python)
Leetcode.283 Move Zeroes Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero e ...
分类:编程语言   时间:2020-07-28 14:38:35    阅读次数:91
Python 判断子序列
s = "abc" t = "ahbgdc" class Solution: def isSubsequence(self, s: str, t: str): for i in range(len(s)): if s[i] in t: if i <= t.index(s[i]) : return s ...
分类:编程语言   时间:2020-07-28 10:16:14    阅读次数:90
14215条   上一页 1 ... 30 31 32 33 34 ... 1422 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!