摘要:
列表可以存储多个值 可读可修改 #remove 删除指定元素 >>> list1 = ['a','b','c','a'] >>> list1.remove('b') >>> print(list1) ['a', 'c', 'a'] #append 追加元素 >>> list1 = ['a','b', 阅读全文
摘要:
去重 无序 没有索引 #remove 删除元素 >>> s1 = {1,2,3,4,5} >>> s1.remove(2) >>> print(s1) {1, 3, 4, 5} #pop 剪切 >>> s1 = {1,2,3,4,5} >>> res = s1.pop() >>> print(res 阅读全文
摘要:
字符串:可用单引号 双引号 三引号 来表示 可用来定义国籍,姓名,家庭住址等选项:#.join 把可迭代的对象转化成字符串 (字符串,列表,元组,字典等),列表 元组 合并为字符串,字典合并的是key >>> res = ''.join(['1','2','3']) #列表 >>> print(re 阅读全文