938664978
938664978
全部文章
python
AI(18)
algorithm(18)
C(6)
computer-vision(15)
cuda(2)
database(1)
fortran(1)
hardware(3)
java(1)
leetcode(39)
MathModeling(19)
matlab(5)
other(8)
robotics(13)
web-development(4)
未归档(5)
归档
标签
去牛客网
登录
/
注册
938664978的博客
全部文章
/ python
(共68篇)
inspect a function object
use inspect module to figure out the attributes in a function object. there is a clip function below: def clip(text, max_len=80): ""&q...
2020-07-14
0
465
simple cases about functional programming
import functools def fac(n): return functools.reduce(lambda a,b:a*b, range(1,n+1)) fac(5) 120 another solution is using operator module ...
2020-07-14
0
382
[DP]strategy
# coding: utf-8 # # Srategy Pattern # 策略模式定义一系列算法并封装它们,这些算法可以互换。 # 策略模式还根据不同的对象使用不同的算法。 # ## class implement # In[10]: import abc import collectio...
2020-07-14
0
373
[DP] 后缀表达式与求值 visitor
后缀表达式与求值 # In[1]: class Node(object): pass class BinaryOperator(Node): def __init__(self, left, right): self.left = left ...
2020-07-14
0
496
[note] Iterator and Iterable
Iterator and Iterable 引言 unfortunately, the versions of Setence below are bad ideas and not pythonic. 实际工作中,要从一个英文句子中逐步迭代处其中的单词,代码可以这...
2020-07-14
0
466
[note]how a generator works
how a generator works A Sentence class was discussed in the previous blog. however, the versions of Sentence haven been created are not py...
2020-07-14
0
391
[note] Basic Information
1.Keywords Keywords Keywords are special words that are reserved by Python and cannot be used by you to name things. They indicate commands...
2020-07-14
0
940
[notes]Iterator-1:Sentence class Python迭代器基本概念
#!usr/bin/env python import re import reprlib RE_WORD = re.compile("\w+") class Sentence(object): def __init__(self, text): se...
2020-07-14
0
420
[notes]chap14 Iterator Generator-expression 生成器表达式
generator-expression生成器表达式 the differences between list comprehension and generator expression def gen_AB(): print("start") yield ...
2020-07-14
0
434
HangMan 猜单词 一个简易的吊死鬼游戏 python版
一个很简单的猜单词游戏。 你的机会是有限的,你每猜错一次,你要拯救的小人就出现一部分。 当整个小人出现的时候,游戏结束,你便看到了惨象:一个吊死的***丝! 可以把单词换成你每天背的单词,便于复习。。。 直接放代码。 #!usr/bin/env python...
2020-07-14
0
1414
首页
上一页
1
2
3
4
5
6
7
下一页
末页