摘要: # 字符串常用方法:字符串也是有下标的,但字符串是不能被修改的 s=' abc'#\n为换行符 # result=s.strip(' c')#去除字符串两侧的空格和换行符(如果指定字符时,去除指定字符),不可去除中间的空格 # s.lstrip()#去掉左侧的空格 # s.rstrip()#去掉右侧的空格 # print(result) # print(s[-1]) # print(s.co... 阅读全文
posted @ 2019-05-13 20:00 mcdull0 阅读(109) 评论(0) 推荐(0) 编辑
摘要: # 字符串 # 数组 list:有序(有下标) # 字典{key:value} dict:无序 dict 格式如下: stu_info={ 'username':'小明', 'password':'123456', 'tel':13254576487, 'add':'北京' } # 创建/定义 字典 d1={}#创建空字典 d2=dict()#创建空... 阅读全文
posted @ 2019-05-13 19:23 mcdull0 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 数组=列表(list) 特征:有序(有下标)。 多维数组: 阅读全文
posted @ 2019-05-06 20:46 mcdull0 阅读(1193) 评论(0) 推荐(0) 编辑
摘要: 循环=迭代=遍历 if 条件判断(变量赋值、input接收的均为字符串): 循环中break和continue的区别案例: 代码1和代码2的效果一样,皆打印三行哈哈 for循环:(数组list循环) import导入模块 用户登录校验: 阅读全文
posted @ 2019-05-06 19:08 mcdull0 阅读(529) 评论(0) 推荐(0) 编辑