@chenbinghua
2017-02-22T08:13:21.000000Z
字数 850
阅读 1720
python
教程: 廖雪峰的Python教程 菜鸟教程的Python3教程
python版本: 3.5
python IDE: pycharm
python 和 pycharm下载地址
目前,Python有两个版本,一个是2.x版,一个是3.x版,这两个版本是不兼容的。

>>> print('hello, world')>>> print('100 + 200 =', 100 + 200)>>> print('The quick brown fox', 'jumps over', 'the lazy dog')The quick brown fox jumps over the lazy dog
name = input('please enter your name: ')print('hello,', name)
# 注意python的缩进a = 100if a >= 0:print(a)else:print(-a)
数值 字符串 布尔值 空值
list 可变数组 对应 NSMutableArrayclassmates = ['Michael', 'Bob', 'Tracy']
tuple 不可变数组 对应 NSArrayclassmates = ('Michael', 'Bob', 'Tracy')
dict 可变字典 对应 NSMutableDictionaryd = {'Michael': 95, 'Bob': 75, 'Tracy': 85}d['Michael']
set 无序和无重复元素的集合 对应java的集合s1 = set([1, 2, 3])
def my_abs(x):if x >= 0:return xelse:return -x
写算法题
Python爬虫
操作Excel
数组和数据类型
List和Tuple
条件判断和循环
Dict和Set
函数
切片
迭代
列表生成式
函数式编程
模块
面向对象编程
定制类
