编程语言
高级 字节码
低级 机器码
python语言
javapython
cpython 常用
pypy 最快
python程序:
1
终端:C:\python36\python.exe c:\1.py
解释器:
2 文件型
#/usr/bin/u/ubv/a python Linux
python 1.py
./1.py 加权限
3 编码
#/usr/bin/u/ubv/a python
#-*- coding:utf-8 -*- 2.7要用
补充:ASCII码值 8位只能表示英文字母
Unicode 最少十六位 全球字母都能表示 浪费空间 万国码
utf-8 以尽量少的位数表示 中文用3个字节表示
GBK 主要针对中文 两个字节表示
4 print()
5 inp=input(‘’) input接收到的所有类型均是字符串
PS:new_inp= int(inp)
6 变量名
字母 数字 下划线
不能以数字开头、不能使用关键字、不要使用内置的词 例:sum
7 if 条件语句
1 基本
2嵌套
3if elif else 缩进 必须一样
8 while 循环
while else
count =0
while count<10:
if count ==7:
count=count+1
break #终止所有循环 直接回去
print(count)
count=count+1
#打印0-6
count=0
while count<10:
count=count+1
if count==7:
pass
else:
print(count)
count =0
while count<10:
count=count+1
if count==7:
continue
print(count)
break 终止之后所有的循环
continue 终止现有的单个循环