01-学习的目录
- 计算机基础
- python历史
- python的环境
- python的发展
- python的种类
- 变量
- 常量
- 注释
- 用户交互
- 基础数据类型
- if
- while
02-学习的目录
- cpu,内存,硬盘,操作系统,应用程序
- pythob历史
- python的分类
03-开始学习
1. 变量
- 变量必须由(数字)(字母)(下划线)组合,且不能用数字开头
- 不能使用关键字
['False', 'None', 'True', 'and', 'as',
'assert', 'break', 'class', 'continue', 'def',
'del', 'elif', 'else', 'except', 'finally',
'for', 'from', 'global', 'if', 'import',
'in', 'is', 'lambda', 'nonlocal', 'not',
'or', 'pass', 'raise', 'return', 'try',
'while', 'with', 'yield']
- 变量必须包含某些含义
- 不能使用中文
- 常量,不可变的,一般大写 A_B_C
- 注释 #
- 多行注释 ‘’’ 注释’’’
- 用户交互:input
name = input('输入名字')
从input接受的数据类型全部都是(str)
name = zhangsan
age = 18
print('名字'%d,'年龄%f,'%name,age)
- if语句,嵌套if
if num == 1:
print(1)
elif num == 2:
print(2)
else:
print(other)
- while循环
count = 1
while count < 100:
count = 1+count
print(count)
- while breakl跳出循环