Fork me on GitHub

2019年3月27日

摘要: # 交集aa={'qwe','asd','zxc'}cc={'uio','qwe'}aa_and_cc=[]for i in aa: if i in cc: aa_and_cc.append(i)print(aa_and_cc)aa={'qwe','asd','zxc'}cc={'uio','qwe',}print(aa.intersection(cc))print(aa&c... 阅读全文

posted @ 2019-03-27 19:59 攀一座山 阅读(270) 评论(0) 推荐(0) 编辑


2019年3月25日

摘要: 中括号括起来 分割每一个元素 列表中的元素可以是数字 字符串 列表 布尔值 都能放进去 索引取值 print( li [] ) 切片,切片结果也是列表 阅读全文

posted @ 2019-03-25 17:38 攀一座山 阅读(106) 评论(0) 推荐(0) 编辑


2019年3月24日

摘要: 写代码,有如下变量,请按照要求实现每个功能 name=" aleX " a.移除 name变量对应的值两边的空格,并输入移除后的内容 b.判断 name 变量对应的值是否以 “ al ” 开头,并输出结果 c.判断 name 变量对应的值是否以 “ X ” 结尾,并输出结果 d.将 name 变量对 阅读全文

posted @ 2019-03-24 13:42 攀一座山 阅读(306) 评论(0) 推荐(0) 编辑


2019年3月23日

摘要: python字符串的方法 ############7个基本方法############ 1:join 2:split(正则) 3:find 4:strip 5:upper 6:lower 7:replace 阅读全文

posted @ 2019-03-23 17:07 攀一座山 阅读(246) 评论(0) 推荐(0) 编辑


Copyright © 2024 攀一座山
Powered by .NET 8.0 on Kubernetes