一、Python简介
Google开源机器学习框架:TensorFlow
Facebook开源机器学习框架:Pytorch
开源社区主推学习框架:Scikit-learn
百度开源深度学习框架:Paddle
Python发展历史
Pycharm下载地址
二、变量
'''
命名规则:
由数字、字⺟、下划线组成
不能数字开头
不能使⽤内置关键字
严格区分⼤⼩写
1、⻅名知义
2、⼤驼峰:即每个单词⾸字⺟都⼤写,例如: MyName
3、⼩驼峰:第⼆个(含)以后的单词⾸字⺟⼤写,例如: myName
4、下划线:例如: my_name
'''
#定义变量
my_name = 'TOM'
print(my_name)
#定义变量
schoolName = '黑马程序员'
print(schoolName)
#默认顶格写,python对顶格有严格的限制,否则出现unexpected indent
三、数据类型
a = 1 #开头不能有空格,否则会报错
print(type(a)) # <class 'int'> -- 整型
b = 1.1
print(type(b)) # <class 'float'> -- 浮点型
c = True #判断使用,只有True和False两个值
print(type(c)) # <class 'bool'> -- 布尔型
d = '12345' #数据要加引号
print(type(d)) # <class 'str'> -- 字符串
e = [10, 20, 30]
print(type(e)) # <class 'list'> -- 列表
f = (10, 20, 30)
print(type(f)) # <class 'tuple'> -- 元组
h = {10, 20, 30}
print(type(h)) # <class 'set'> -- 集合
g = {'name': 'TOM', 'age': 20}
print(type(g)) # <class 'dict'> -- 字典
四、注释
# 注释内容 快捷键: ctrl+/
"""
下⾯三⾏都是输出的作⽤,输出内容分别是:
hello Python
hello itcast
hello itheima
"""
print('hello Python')
print('hello itcast')
print('hello itheima')
'''
下⾯三⾏都是输出的作⽤,输出内容分别是:
hello Python
hello itcast
hello itheima
'''
print('hello Python')
print('hello itcast')
print('hello itheima')
五、Debug工具
步骤:
- 打断点
- Debug调试
断点位置
⽬标要调试的代码块的第⼀⾏代码即可,即⼀个断点即可。
打断点的⽅法
单击⽬标代码的⾏号右侧空⽩位置