# python知识总结 **Repository Path**: kelingT/summary-of-python-knowledge ## Basic Information - **Project Name**: python知识总结 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-12-04 - **Last Updated**: 2021-01-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 上半学期python知识总结 ## 开发环境 ``` Python 开发环境 = { "IDE":{ "IDLE":["操作":90,"意义":90], "Anaconda":["安装":100,"操作":90,"Markdown":90], "Pycharm":["安装":80,"操作":80] } } ``` ## if语句 and For循环 ``` Python Python_knowledge = { "if 语句":["操作":90, "意义":100] , # if;elif;else的用法及嵌套 "for循环":["操作":80, "意义":90], "range内置函数":["操作":90,"意义":100], #迭代循环数字变量;两相结合;例,用for循环求解1+2+3..+100的总和 # start: 计数从 start 开始。默认是从 0 开始。例如range(5)等价于range(0, 5); # stop: 计数到 stop 结束,但不包括 stop。例如:range(0, 5) 是[0, 1, 2, 3, 4]没有5 # step:步长,默认为1。例如:range(0, 5) 等价于 range(0, 5, 1) ``` ## random模块 ``` Python Python_knowledge = { "random模块":["操作":80,"意义":90], # random.random(),random.uniform(a,b),random.randint(a,b),random.randrange([start], stop[, step]) # random.choice(sequence),random.shuffle(x[, random]),random.sample(sequence, k) } ``` ## 字符串 ``` Python Python_knowledge = { "字符串":{ "join":["操作":80,"意义":80], "split":["操作":70,"意义":90],# 拆分 "count":["操作":80,"意义":90],# 计算 } } ``` ## 字符串 ``` Python Python_knowledge = { "列表":{ "切片":["操作":80,"意义":80],# list[start,end,step] "列表函数":["操作":90,"意义":90], # len(list)检查个数 # max(list)检索最大值 # min(list)检索最小值 # list(seq)元组转列表 #其他: # list.append(obj),list.count(obj),list.extend(seq), # list.index(obj),list.insert(index, obj),list.pop([index=-1]), # list.remove(obj),list.reverse(),list.sort(cmp=None, key=None, reverse=False) } } ``` ## 字典 ``` Python Python_knowledge = { "字典":{ "键:值":["操作":90,"意义":90], "函数":["操作":80,"意义":80], # len(dict) # str(dict)输出字典打印的字符串表示 # 其他: # dict.clear(),dict.copy(),dict.get(key, default=None),dict.items(), # dict.keys(),dict.setdefault(key, default=None),dict.values(), # dict.update(dict2),pop(key[,default]),popitem() } } ``` ## 集合 ``` Python Python_knowledge = { "集合":{ "函数":["操作":80,"意义":80], # set.add() # set.clear(),set.copy(),set.difference(), # set.discard(),set.intersection(),set.isdisjoint(), # set.pop(),set.symmetric_difference(),set.union() } } ``` ## 集合 ``` Python Python_knowledge = { "函数":{ "定义":["操作":70,"意义":90],# def 函数名(参数列表): 和 return "调用":["操作":80,"意义":90], "参数":["操作":70,"意义":90],#必需参数,关键字参数,默认参数,不定长参数 } } ```