After following, you can keep track of his dynamic information in a timely manner
Courses in the relevant section:Design your first game in Python
1. IDLE 是什么? IDLE是一个Python Shell,shell的意思就是“外壳”,基本上来说,就是一个通过键入文本与程序交互的途径!像我们Windows那个cmd窗口,像Linux那个黑乎乎的命令窗口,他们都是shell,利用他们,我们就可以给操作系统下达命令。同样的,我们可以利用IDLE这个shell与Python进行互动。
Built-in function 内置函数
dir(__builtins__) 输出的都是小写的是内置函数 help(内置函数名)查看该内置函数解释
2019-02-190个赞
Courses in the relevant section:Variables and strings
原始字符串的使用: 只需在字符串前 加一个 r ; str =r'C:\now\book\engs\fff' 适用于一个字符串有很多反斜杠
得到跨多行字符串 ,使用三重引号 “““ 你好, 我好, 大家好。 ”””
2019-02-190个赞
Courses in the relevant section:Common operators in Python
and 两边斗为真返回TRUE,有一边为假返回FALSE; or 两边都为假返回FALSE,一边为真返回TRUE; ! 真返假,假返真; 先乘除后加减,括号最先,幂(**)高于左边,低于右边 //整除
2019-02-220个赞
Courses in the relevant section:Awesome branches and loops 2
if 条件 ...elif 条件...else ... 最后else是不可以带条件的,默认以上情况都不存在时发生
2019-02-220个赞
Courses in the relevant section:Awesome branches and loops 3
range(10) = [0,10) ; range(1,6) =[1,6) ; range(6) = [0,6) ; range(2,10)=[2,10) ; 一个参数,从0开始;两个参数,从第一个参数开始;含头,不含结尾;
2019-02-220个赞
Courses in the relevant section:List: an array on steroids
数组:同类型的数据,放一起;Python变量没有数据类型,故python没有数组,但有列表; 列表:不分数据类型,所有类型数据均可放一起。
append:在元组末尾追加元素(字符串,数字,元组);一次只能追加一个; extend:在元组中追加多个元素,以元组(由字符串,数字,元组组成)形式追加; insert:在指定位置追加元素(字符串,数字,元组);一次只能追加一个;
2019-02-220个赞
Courses in the relevant section:List: an array on steroids 2
列表通过从0开始的索引获取对应的列表中的元素; remove()通过元素值(列表),删除列表某个元素;del 删除整个列表;pop;删除列表最后一个元素,并返回该元素值
2019-02-220个赞
Courses in the relevant section:Classes and Objects: Inheritance
子类继承父类:防止同名方法覆盖 定义方法时在方法内调用父类方法 def __init__(self):
2019-02-200个赞
Courses in the relevant section:Introduction to small program development
https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/devtools.html
2019-02-120个赞