python初学

摘要: #!/usr/bin/env python# -*- coding:utf-8 -*-注释:单行: #多行: ''' 阅读全文
posted @ 2017-10-16 23:09 懒虫遇见辉 阅读(99) 评论(0) 推荐(0) 编辑

*Python学习1_dict

摘要: dict用大括号定义: d={'wd':123,'abc':456} 用dict定义: lst=[('wd','pc'),[1,2]] dct=dict(lst) print dct {1: 2, 'wd': 'pc'} 字典的基本行为和list类似 len(d)返加总数 名字称为key,对就的值称 阅读全文
posted @ 2017-07-23 21:38 懒虫遇见辉 阅读(116) 评论(0) 推荐(0) 编辑

Python学习1_tuple

摘要: 元组是一种有序的列表 和list非常 类似,但是tuple一量创建,就不能修改 >>> t={'wd','pc','me} >>>t1=tuple('abc') >>>print t1 ('a','b','c') 创建tuple和list不同之处,就是用()代替[] 通过t[0]等方式访问元组,和l 阅读全文
posted @ 2017-07-23 20:59 懒虫遇见辉 阅读(89) 评论(0) 推荐(0) 编辑

Python学习1_list

摘要: list: [] dict:{} tuple:() list: in , max , in, append,count,extend,index,insert,pop,remove,reverse 阅读全文
posted @ 2017-07-23 19:58 懒虫遇见辉 阅读(110) 评论(0) 推荐(0) 编辑