1.语言基本知识
1.1 编译器
1.1.1 定义
人生苦短,我用python
cython
机器只能理解机器语言
程序员编写代码(java c c++ c# python go 等)------->翻译成机器语言------>计算机执行
编译器:将其他语言翻译成机器语言的工具
1.1.2 编译器的翻译方式
编译
解释
区别:翻译时间点的不同
当翻译器以解释方式进行运行的时候,叫做解释器
1.1.3 语言的分类
编译型语言:执行速度很快
解释型语言:跨平台
2.解释型语言-python
2.1 输出-print
def print(self, *args, sep=' ', end='\n', file=None): # known special case of print
"""
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments://可选参数
file: a file-like object (stream); defaults to the current sys.stdout.// 基本不用管
sep: string inserted between values, default a space.// 分割符,默认是空格
end: string appended after the last value, default a newline.// 换行符
flush: whether to forcibly flush the stream.
"""
pass
2.2 注释
2.2.1 单行注释
#
快捷方