s12-20160116-day03 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
上节课总结 1 运算符 in 字符串 判断  : “hello” in "asdasfhelloasdfsadf" 列表元素判断:"li" in ['li', 'ok'] 字典key判断:key in dic.keys() 2 基本的数据类型 类名() 其实就是执行类的 __init__ int() __init__(self,args,base=10) int a. 创建方式 两种 n1 = 123 # 根据int类,创建了一个对象 n2 = int(123) #…
内容概要: 数据类型操作补充 集合及其操作 深浅拷贝1.基础数据类型补充 1.1字符串的操作补充li = ["李嘉诚", "麻花藤", "黄海峰", "刘嘉玲"]s = "_".join(li) # 添加后列表变成字符串print(type(s),s) li = "黄花大闺女"s = "_".join(li) # 仍然是字符串print(type(s),s) 1.2列…
*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin: 15px 0; } /* HEAD…
集合 # 集合 ''' 集合是无序不重复的 ''' # 创建列表 l = list((1, 1, 1)) l1 = [1, 1, 1] print(l) print(l1) print("**************") # 创建集合 s = set('wjw') print(s, type(s)) print("-----------------") print(set("wjw")) print("+++++++++++++++++…
一.上节课的重点回顾: 1.类名加括号其实就是执行类的__init__方法: 2.int a.创建方式 n1 = 123 #根据int类创建了一个对象 n2 = int(123) #根据int类创建一个对象,类的实例化就是对象 b.int内部优化 1.n1和n2的内存地址相同 n1 = 123 n2 = n1 2.按理说n1和n2的内存地址应该不同,这是由于python的内部机制的原因, 在-5~257以内的数,按2的方式写,都是指向同一个内存 n1 = 123 n2 = 123 除此之外的数,…
1.基本数据类型补充 2.深浅拷贝 DAY7-基本数据类型(基本数据类型补充&深浅拷贝) 本节主要内容: 1.补充基础数据类型 (1)join方法 (2)split方法 (3)列表不能在循环时删除,因为索引会发生改变 (4)字典不能直接删除,要把删除的内容先记录在列表中,循环列表,删除字典中的数据 (5)fromekeys()不会对原来的字典产生影响,面试常考题(巨坑) 2.深浅拷贝部分 (1)=从上到下只有一个列表创建 (2)copy 等价于[:]切割 (3)引入一个模块:import cop…
四.小数据池,深浅拷贝,集合+菜中菜 1小数据池 --缓存机制(驻留机制) ​ '==' 判断两边内容是否相等 ​ 'is' 基于内存地址进行判断是否相同 a = 10 b = 10 print(a == b ) #is print(a is b) 小数据池的数字范围: -5 ~256 a = -5 b = -5 c = -5 print(id(a)) print(id(b)) print(id(c)) #<-5不行 a = -6 b = -6 print(id(a)) print(id(b))…
编码 : a.encode(' ')     windows 默认编码GBK ASCII : 最早的编码. ⾥⾯有英⽂⼤写字⺟, ⼩写字⺟, 数字, ⼀些特殊字符.没有中⽂, 8个01代码, 8个bit, 1个byte UNICODE: 万国码, ⾥⾯包含了全世界所有国家⽂字的编码. 中文: 32个bit, 4个byte, 英文: 16个bit,2个byte UTF-8: 可变⻓度的万国码. 是unicode的⼀种实现. 最⼩字符占8位 1.英⽂: 8bit 1byte 2.欧洲⽂字:16bit…
目录 1. 基础数据类型补充 2. set集合 3. 深浅拷贝 1. 基础数据类型补充 (1)join方法 join方法是把一个列表中的数据进行拼接,拼接成字符串(与split方法相反,split方法是把一个字符串切割成列表) In [1]: l1 = ['a', 'b', 'c'] In [2]: s1 = '' In [3]: for i in l1: # 如果不使用join方法需要自己使用循环拼接成字符串 ...: s1 += i + '-' In [4]: s1.strip('-') O…
上节内容回顾:C语言为什么比起他语言块,因为C 会把代码变异成机器码Pyhton 的 .pyc文件是什么python 把.py文件编译成的.pyc文件是Python的字节码, 字符串本质是 字符数组, python 一切事物都是对象,对象是类创建的,像 增加删除更改 都存在于类里边,也可以称作类的成员 set集合 set是一个无序且不重复的元素集合 class set(object): """ set() -> new empty set object set(iter…
一.字符串格式化 Python的字符串格式化有两种方式: 百分号方式.format方式 百分号的方式相对来说比较老,而format方式则是比较先进的方式,企图替换古老的方式,目前两者并存.[PEP-3101] This PEP proposes a new system for built-in string formatting operations, intended as a replacement for the existing '%' string formatting operat…
三元运算 三元运算,又称三目运算,主要作用是减少代码量,是对简单的条件语句的缩写. 书写格式: result = 值1 if 条件 else 值2 即如果条件成立,则将值1赋给result变量,如果不成立,将值2赋给result变量 eg:name = "tina" if 1==1 else "fei" name = "tina" if 1!=1 else "fei" print(name) 执行结果如下: fei  小练习:…
算数运算符: Py2中精确除法需要导入:from __future__ import division,(符由特  ,将来的.滴未省,除法) py3不需要导入 赋值运算符: 比较运算符: 成员运算符: 逻辑运算符(布尔运算符): 身份运算符: 内存的读写速度比硬盘要快,3.0里面二进制和字符型必须严格区分 人的痛苦都是对自己无能的愤怒,python一行最多输80个字符 多线程可以并行运算 单线程串行执行 位运算符: 六个标准的数据类型: 一般字符串执行一个功能,生成一个新的内容,原来内容不变,只…
s12-20160319-day10 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160123-day04 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160109-day02 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
集合 学习集合的目标: 会使用集合存储数据 会遍历集合,把数据取出来 掌握每种集合的特性 集合和数组的区别 数组的长度是固定的.集合的长度是可变的. 数组中存储的是同一类型的元素,可以存储基本数据类型值.集合存储的都是对象.而且对象的类型可以不一致,在开发中一般当对象多的时候使用集合进行存储. 集合框架 JAVASE提供了满足各种需求的API,在使用这些API前,先了解其继承与接口操作架构,才能了解何时采用哪个类,以及类之间如何彼此合作,从而达到灵活应用. 集合按照其存储结构可以分为两,分别是单…
s12-20160305-day08 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160130-day05 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
第一阶段:Python 语言基础 数据类型 流程控制 常用模块 函数.迭代器.装饰器 递归.迭代.反射 面向对象编程 购物车程序 计算器程序开发 模拟人生游戏开发 第二阶段:网络编程 Socket c/s 编程.Twisted 异步网络框架.网络爬虫开发 多线程.多进程.携程 gevent .select\poll\epoll 生产者消费者模型 审计堡垒机系统开发 FTP 服务器开发 批量命令.文件分布工具 RabbitMQ 消息队列.SqlAlchemy ORM 类 SaltStack 配置管…
基础数据类型总览 why:机器无法像人一样分编各种类型 int(数字) str(字符串)作用:存储少量信息. '12','我和你','qw' bool值 作用:判断真假 True False list(列表) 作用:存储大量数据,可改变里面的元素. [12,[1,2,3,a],True,'wo'] tuple(元组)作用:存储大量数据,不可改变里面的元素. (12,False,'wo',[1,2,3]) dict(字典)作用:存储大量关联型数据,查询速度快.{'name':'山就在这儿','ag…
s12-20160430-day15 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160507-day16 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160409-day13 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
--取出集合;长度 declare type list_nested ) not null; v_all list_nested := list_nested('a','b','c','d','c','d'); begin dbms_output.put_line('list leng :' || cardinality(v_all)); end; / --从集合中取出取消重复的元素 declare type list_nested ) not null; v_all list_nested :…
s12-20160312-day09 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160227-day07 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160130-day06 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
https://www.cnblogs.com/songqingbo/p/5129116.html(转载学习)…