
python
文章平均质量分 93
Knight Moon
这个作者很懒,什么都没留下…
展开
-
正则表达式(Regular Expression)——入门笔记(常用正则表达式符号、正则表达式在线调试工具)
1.正则表达式到底是什么东西?正则表达式(英语:Regular Expression,在代码中常简写为regex、regexp或RE)是用于描述字符串规则的工具。换句话说,正则表达式就是记录文本规则的代码。正则表达式语言由两种基本字符类型组成:原义(正常)文本字符和元字符(metacharacter)。元字符使正则表达式具有处理能力。所谓元字符就是指那些在正则表达式中具有特殊意义的专用字符,可...原创 2019-03-24 18:46:26 · 4673 阅读 · 0 评论 -
python精选例题笔记(每日一练)——中缀表达式转后缀表达式 Infix to Postfix
1.题目Infix to PostfixWrite a function to convert a infix string into a postfix string. For this quiz, you may assume the string only contains numbers and the following operator: +, -, *, /, (, ).将中缀...原创 2019-03-21 14:40:24 · 565 阅读 · 0 评论 -
python精选例题笔记(每日一练)——计算后缀表达式的值 Evaluate Postfix String
1.题目Write a function to evaluate a postfix string.计算后缀缀表达式 ‘2532*1++3/+’ 的值。2.解题思路从左到右扫描表达式:(1)当前扫描到的是数字,直接入栈;(2)当前扫描到的是符号,将栈顶两数字出栈与当前符号计算,将计算后的值入栈;(3)将表达式全部扫描完毕,栈内剩下的数就是后缀表达式的值。3.code:小技巧:用...原创 2019-03-21 15:17:10 · 625 阅读 · 0 评论 -
python精选例题笔记(每日一练)—— 创建链表的类 create class LinkedList
1.题目Creat class Linked List (Unordered)List of operations a link list should supported:1.Initialize (empty/from list)2.isEmpty3.add(val)4.remove(val)5.str6.repr7.index8.contains9.insert(idx...原创 2019-03-21 23:06:33 · 353 阅读 · 0 评论 -
python精选例题笔记(每日一练)—— Python绘图问题:使用Python-matplotlib进行可视化绘图时,%matplotlib inline的作用
使用jupyter notebook 或者 jupyter qtconsole的时候,我们有时会需要用Python–matplotlib进行可视化绘图,可能会遇到%matplotlib inline,其作用为:当你调用matplotlib.pyplot的绘图函数plot()进行绘图的时候,或者生成一个figure画布的时候,可以直接在你的python console里面生成图像。而我们在spy...原创 2019-04-10 22:01:43 · 829 阅读 · 0 评论