/basic_python

just python learning

Primary LanguagePython

basic_python

创建这个库的目的是为了,学习python,这里负责基础

目录:

* 简单介绍
1. 安装

Linux sudo -y yum install python
mac brew install python
window 官网下载安装

2. python shell

进入python shell python
退出python shell exit()

3.1 变量
 大小写都可 eg: a = 1 b = 'abc',无需用‘,’分割
3.2
 流程控制 (注意:不可少, 没有结束的end, 靠缩进来标志开始)

#if判断
if gaurd:
    print('hello world')
elif:
    print('elif hello world')
else:
    print('else hello world')

#循环
for obj in lists:
    print(obj)

while(guard):
    print('hello world')

3.3集合
有列表[a,b,c] 和元组(a,b,c),都支持遍历,元组不可变
3.4字典
key-value结构

#dict
dict ={'hello': world} 
print(d.get('hello'))
d['hello'] = 11
print(d['hello'])
# set
s = set([1, 2, 3])
print(s)

3.5函数

def funtionname():
    print("hello, world")

 3.5.1函数参数
 wait context
3.6 python的特性
wait context
 3.6.1 切片
 wait context
#####4. 编写一个程序 1.excel #####5. 阅读一个github的python项目 1.excel工具
2.爬虫项目爬虫参考这个知乎 #####6. 引用资料