![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
WinddyAkoky
这个作者很懒,什么都没留下…
展开
-
python学习笔记之list和tuple【2】
list Python內置的一種數據類型是列表: list. list是一種有序的集合,可以隨時添加 和刪除元素.>>> classmates = ['winddy','selly','marry']>>> classmates['winddy', 'selly', 'marry']變量 classmates 就是一個list, 用 l...原创 2018-04-09 20:48:03 · 172 阅读 · 0 评论 -
python学习笔记之条件和循环语句【3】
條件判斷格式: if 判斷語句 : 語句 注意上面是沒有分號的. 編譯器根據縮進判斷語句是不是被包含在if語句裏面 注意冒號不要漏掉!!! 只要判斷語句是非零数值、非空字符串、非空list等,就判断为True,否则为False。age = 3if age >= 18: print 'your age is', age...原创 2018-04-09 20:49:23 · 143 阅读 · 0 评论 -
python学习笔记之dict和set【4】
dictPython内置了字典: dict支持,dict 全称dictionary,在其他语言也成为map, 使用见-值存储,具有极快的查找速度. 格式: {键:值}>>> d = {'winddy':99, 'selly':93, 'amy':98}而访问字典时,只需要键就能找到对应的值, 如输入d[‘winddy’],则会输入99. 如果k...原创 2018-04-09 20:51:51 · 155 阅读 · 0 评论 -
python学习笔记之函数【5】
定义函数 格式: def 函数名( 参数 ): 可执行代码def print_my(x): print('windyy: %s' % x) return参数可有可无返回值可有可无.如果没有返回值,默认返回 None空函数. 如果想定义一个什么事都不做的函数,可以用 pass语句 def nop(): passpass语...原创 2018-04-09 20:53:18 · 151 阅读 · 0 评论 -
Pycharm安装并配置jupyter notebook
Pycharm安装并配置jupyter notebook一: 安装命令jupyter: pip install jupyter如果缺少依赖,缺啥装啥二: 运行 jupyter notebook首先,查看一下自己是否已经安装成功,在终端输入:jupyter notebook如果运行成功,结果如下:[I 09:03:15.177 NotebookApp] J...原创 2018-07-10 09:50:02 · 18045 阅读 · 7 评论 -
ModuleNotFoundError: No module named 'compiler'
一、报错原因:python3 废除了包 compiler二、解决方法:把下面代码粘贴到你的程序里import collectionsdef flatten(x): result = [] for el in x: if isinstance(x, collections.Iterable) and not isinstance(el, str): ...原创 2018-09-24 15:46:34 · 4157 阅读 · 3 评论 -
python 批量安装和卸载库/安装包
显示已经安装的包名及其版本pip freeze将已经安装的包名及其版本写入txt文件pip freeze > requirement.txtpip 批量安装包/库pip install -r requirement.txt或者你也可以批量卸载包pip uninstall -r requirement.txt...原创 2018-09-21 16:52:27 · 4284 阅读 · 1 评论