2018年3月22日

集合

摘要: 集合的特性 不同元素组成 无序 集合中的元素必须时不可变类型 集合的方法 add clear copy difference difference_update discard intersection intersection_update isdisjoint issubset issupers 阅读全文

posted @ 2018-03-22 19:48 lurches 阅读(120) 评论(0) 推荐(0) 编辑

字典

摘要: 字典的特性 键对值 字典的valu值可以任意值 列表、字典不能最为字典的key 所以索引方式找到指定元素 字典支持del删除 字典是可迭代对象 字典的方法 clear copy fromkeys get items keys pop popitem setdefault update values 阅读全文

posted @ 2018-03-22 16:47 lurches 阅读(127) 评论(0) 推荐(0) 编辑

元组

摘要: 元组的特性 创建元组的时候,推荐在最后的加入逗号(,) 元组的元素不可被修改,不能增减 能够索引,切片 可迭代对象 可以转换成列表 有序 元组的方法 count index 阅读全文

posted @ 2018-03-22 16:05 lurches 阅读(97) 评论(0) 推荐(0) 编辑

数字

摘要: int()将字符串转换成数字。 1 #输入看似数字,实则是以字符串输入,同input() 2 a = "123" 3 print (type(a),a) 4 #将字符串转化成数字 5 b = int(a) 6 print (type(b),b) 7 8 #结果 9 #a未经转换,它是字符串类(str) 10 123 11 #b经转换,它是字数字类(i... 阅读全文

posted @ 2018-03-22 15:53 lurches 阅读(119) 评论(0) 推荐(0) 编辑

导航