摘要: ####################### 整理 ################# # 一、数字# int(..)# 二、字符串# replace/find/join/strip/startswith/split/upper/lower/format# tempalte = "i am {na 阅读全文
posted @ 2019-01-09 23:07 zhangshh 阅读(120) 评论(0) 推荐(0) 编辑
摘要: # 字典# dict(类)# dict# dic = {# "k1": 'v1',# "k2": 'v2'# }# 1 根据序列,创建字典,并指定统一的值# v = dict.fromkeys(["k1",123,"999"],123)# print(v) # 2 根据Key获取值,key不存在时, 阅读全文
posted @ 2019-01-09 23:06 zhangshh 阅读(110) 评论(0) 推荐(0) 编辑
摘要: # 元组,元素不可被修改,不能被增加或者删除# tuple# tu = (11,22,33,44)# tu.count(22),获取指定元素在元组中出现的次数# tu.index(22) ####################################### 深灰魔法 ########### 阅读全文
posted @ 2019-01-09 22:49 zhangshh 阅读(105) 评论(0) 推荐(0) 编辑