一,Python 起源:1989 龟叔在休闲时间创立的语言.
1.Python 属于解释性语言 弱类型.
编程语言分为:
1.编译型语言:如 C.将代码直接交给编译器进而形成二进制给电脑进行运行
2.解释性语言.:Python :将代码交给解释器 由解释器
3.混合型语言:Java
2.变量:将运算结果暂存到变量中以备后续使用
变量的命名规则:
1.变量是由数字,字母,下划线组成
2.不能以数字开头,也不能是纯数字
3.变量命名要有意义
4.变量不要过长
5.变量不要用中文
6.变量不要使用内置关键字
7.变量区分大小写
8.推荐变量使用驼峰命名法或者下划线连接:
驼峰:第一个单词字母小写其他单词首字母大写 如:appleAir
下划线:用下划线连接不同单词 如:apple_air
二.常量:
常量书写格式为字母全大写
三.注释
单行注释用#
多行注释用''' '''
四.三个基本数据类型
int()整数型 str()字符串类型 bool()布尔类型
input()输出后的类型为字符串类型!如果要和数字比较需要转化为int()