摘要: 对列表,字符串,元组,字典 进行操作,合并目录 1 s = 'hello world' 2 3 i = ' ' 4 5 print(i.join(s) ) 1 s = 'hello world' 2 3 4 5 print(' '.join(s) ) 1 s = ('hello','world') 阅读全文
posted @ 2020-03-06 20:46 luoluokang 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 一 数字 int() 二、字符串必须背得这个七个基本常用魔法1.join2.split3.find4.strip5.upper6.lower7.replace8.startswith9.format 三、列表1.append 2.extend3.insaert*******************灰 阅读全文
posted @ 2020-03-06 08:53 luoluokang 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 1、字典的基本结构 2、字典的value可以是任何值 3、布尔值(1,0),列表,字典不能作为字典的key 4、字典是无序的 5、索引方式找到指定元索 6、字典支持del删除 7、for循环 阅读全文
posted @ 2020-03-06 08:49 luoluokang 阅读(98) 评论(0) 推荐(0) 编辑
摘要: #元组,元素的一级不可被修改,不能被增加或者删除,但是元组嵌套的列表或其他值可以被修改 #元素不可被修改,不能被增加或者删除 #2索引 #3切片 #4可以被for循环,可迭代对象 #5,转换 字符串,列表,元组可以相互转换 #含有数字要用for循环 #6扩展 #元组有序 #补充:元组的一级元素不可被 阅读全文
posted @ 2020-03-06 08:48 luoluokang 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 1 # s = "poiu" 2 # li = ["ijh",7894] 3 # tu = (123,456,789) 4 # v = list(s) 5 # print(v) 6 7 # s = "跞跞" 8 # v = len(s) 9 # print(v) 10 11 12 # n1 = 10 阅读全文
posted @ 2020-03-05 17:49 luoluokang 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 1 name = "跞跞" 2 if "跞" in name: 3 print ('I LOVE YOU') 4 else: 5 print('I LOVE YOU,TOO') 1 name = "跞跞" 2 if "跞" not in name: 3 print ('I LOVE YOU') 4 阅读全文
posted @ 2020-03-04 15:45 luoluokang 阅读(248) 评论(0) 推荐(0) 编辑
摘要: print (‘hello world’) 阅读全文
posted @ 2020-03-03 07:21 luoluokang 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Never compromise. 阅读全文
posted @ 2020-03-02 12:22 luoluokang 阅读(74) 评论(0) 推荐(0) 编辑