![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
鲜卑大帝
在互联网大潮中挣扎的miller.fan。
展开
-
python的链表与数组对比,优势和劣势
1、python中的链表如何实现class Node(object): def __init__(self, data, next): self.data = data self.next = nextif __name__ == '__main__': head = None for n in range(1,6): ...原创 2020-02-25 23:12:18 · 1389 阅读 · 1 评论 -
Python之高级函数-高级程序员与普通程序员的区别
python的高阶函数1、假如你想从一个考试分数的列表中删除所有的0分,怎么办?普通程序员:第一步:定义一个函数def remove_zero(yourList): newlist = [] for number in yourList: if number > 0: newlist.append(number) ...原创 2020-02-20 15:50:31 · 320 阅读 · 1 评论 -
python之中文分词
目录1、安装和使用jieba2、分词练习3、为jieba添加自定义的词典4、知识点普及1)分词文件怎么写2)jieba.cut()参数说明1、安装和使用jieba直接用命令:pip3 install jieba就可以了,如图所示表示成功。2、分词练习import jiebaif __name__ == '__main__': seg_gu=...原创 2020-02-17 18:39:41 · 694 阅读 · 0 评论 -
Python之经典案例---扑克发牌程序
目录1、 用Card类表示一张牌2、 用Hand表示一个牌手(玩家)3、用poke类表示一幅牌,可以看做拥有全部54张牌的牌手4、发牌主程序5、测试结果1、 用Card类表示一张牌# 一张牌的抽象class Card(): """A playing card""" RANKS = ['A','2','3','4','5','6','7','8...原创 2020-02-16 20:09:54 · 5574 阅读 · 6 评论 -
python实战篇---类
1、Python的类如何定义?class Fruit: # 类属性 price = 0 # 通过类名和对象名都可见 def __init__(self): self.__color="Red" # 定义和设置私有属性 self.__city = 'beijing' # 定义和设置私有属性 ...原创 2020-02-16 19:06:05 · 190 阅读 · 0 评论 -
初识Python
目录工具:mac笔记本, 安装了Python3.7.0; 编程工具:IDLE.列表:递归:迭代:工具:mac笔记本, 安装了Python3.7.0 ; 编程工具:IDLE.列表:movices = ["The Holy Grail", "The Life of Brian", "The Meaning of Life"]python的列表不用标识数据类型...原创 2020-02-10 13:09:17 · 224 阅读 · 2 评论