0003.5-20180422-自动化第四章-python基础学习笔记--脚本 1-shopping """ v = [ {"name": "电脑","price":"1999"}, {"name": "鼠标", "price": "10"}, {"name": "游艇", &q…
内容回顾: - bytes - str 和bytes - int - str - list - tuple - 深拷贝和浅拷贝 今日内容: 数据类型 - bytes - int - str - bool - list - tuple - dict (字典) dic = {'k1':'v1'} - values - keys - items - get - setdefault - fromkeys dict.fromkeys - update - pop - popitem - copy - c…
day6 内容回顾: 1. 变量 2. 条件 3. while循环 4. 数据类型 - int - bit_length - bool - True/False - str - upper - lower - strip - split - replace - join - capitalize - startswith - endswith - isdecimal - list - append - insert - reverse - tuple - - dict - get - items…
内容回顾:1.数据类型 2.for和while循环 continue break #如下循环将怎么打印结果? for i in range(1,10): print(i) for i in range(10,20): print(i) #如下循环将怎么打印结果?----结果只打印1 for i in range(1,10): print(i) break for i in range(10,20): print(i) #如下循环将怎么打印结果?----只打印1,10-19 for i in ra…
3章 内容回顾: 1. 计算机组成 2. 程序编译器 3. 变量 4. 条件 5. 循环 6. py2与py3区别 - 默认编码, - 除法, - input ,raw_input 7. 位,字节关系 8. 运算符: - and or - in not - py2 除法特殊代码 - += -= 9. 编码 汉字在utf-8里位3个字节,24位:汉字在GBK里是两个字节,16位 ascii --> unicode(4个字节,32位表示) ->(优化) utf-8/utf-16/utf-32 10…
======================学习python==================介绍: python种类: cpython(*),jpython,ironpython,rubypython,pypy ... 种类有很多,规则只有一个 python版本 Python2.7 Python3.x 学习Phtyon,学习规则 1. 安装解释器 python.exe 解释器程序 2. 写代码,让解释器运行 ”黑框“:开始->cmd->回车 - 解释器路径 代码文件路径 (写代码) 添加操…
第四章 复合类型 1. 数组概述 1.1 数组的定义 数组(array)是一种数据格式,能够存储多个同类型的值.每个值都存储在一个独立的数组元素中,计算机在内存中依次存储数组的各个元素. 数组声明的三个特点: 存储在每个元素中的值的类型 数组名 数组中的元素数 C++中可以通过修改简单变量的声明,添加中括号(其中包含元素数目)来完成数组声明. 例如: short days[24]; // 一天有24个小时 1.2 数组的声明 声明数组的的一般语法格式为: // 数组类型 数组名字[数组的大小]…
参考资料: 1. <Python基础教程> 2. http://www.runoob.com/python/python-chinese-encoding.html 3. http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000 ▶ If条件语句 条件语句的使用实例如下: #!/usr/bin/python # -*- coding: UTF-8 -*- # 例2:elif用法 num…
1.list L = ['a','a','a','a','a','a3'] L[0] = a L[-1] = a3   添加新元素 L.append('paul') L.insert(-1,'Paul') 删除元素 L.pop(2) list 里面元素不要求必须是同一种数据类型 L.remove('Paul')       2.tuple  (元组),tuple 一旦创建即不能修改: t = ('a',2,'awefawe',4) t[0] = a print t     t = (1) 因为(…
声明:  本人是在校学生,自学python,也是刚刚开始学习,写博客纯属为了让自己整理知识点和关键内容,当然也希望可以通过我都博客来提醒一些零基础学习python的人们.若有什么不对,请大家及时指出,欢迎评论指点.  首先,在我的第一本python书的第一页就写了这样一段话“life is short,you need python-----Bruce Eckel” “人生苦短,我用python”工欲善其事,必先利其器.我们要成为“大牛”,要用python去拯救世界,要做的第一件事就是要下载一个…