随笔分类 - python
Show all python articles!
摘要:代码块 代码块的定义 所有的代码都依赖于代码块进行执行,代码块可以是一个文件、函数、类等 交互式命令下一行就是一个代码块 代码块的缓存机制 同一代码块下的缓存机制 前提条件:代码在同一个代码块内 机制内容:Python在执行初始化对象的时候,回检查之前有没有初始化过这个变量,如果有就指向这个内存。
阅读全文
摘要:字符串 通过双引号或者单引号引起来的字符称之为字符串。 字符串的大小写转换 string = "The is string!" # 将所有字母转换为小写 print(string.lower()) # 将所有字母转换为大写 print(string.upper()) # 将每一个单词的首字母转换为大
阅读全文
摘要:def list_dict(dictlist): def function(date): return date['ip'] dictlist_new = [] for list_dict in dictlist: list_dict['backPath'] = [list_dict['backPa
阅读全文
摘要:for x in range(1,10): for y in range(1,10): if x>=y: print("%d*%d=%d\t"%(y,x,x*y),end='') print()
阅读全文

浙公网安备 33010602011771号