跳转至

Python介绍

Python提供了高效的高级数据结构,还能简单有效地面向对象编程。Python语法和动态类型,以及解释型语言的本质,使它成为多数平台上写脚本和快速开发应用的编程语言。随着版本的不断更新和语言新功能的添加,逐渐被用于独立的、大型项目的开发。

Python版本

  • Python3.12 - [alpha] - 加速编译解释
  • Python3.11 - [security] 精准的错误提示;在__pycache__缓存字节码,提高加载速度
  • Python3.10 - [security] 优化错误提示;首次支持管道运算符|来指定类型集合
  • Python3.9 - [security] 类型提示大幅增强;不再支持Windows7及以下版本操作系统
  • Python3.8 - [security] 新增海象运算符:=
  • Python3.7 - [security] 警告:此版本将于2023-06-27 End of life
  • Python3.6 - [EOL] 新增f语法,例如f'My name is {}'的语法
  • Python3.5 - [EOL] 开始支持async异步语法;开始支持typing类型提示
  • Python3.4 - [EOL] 开始支持枚举类型enum

Python相关网站

Hello, world!

main.py
1
2
3
4
5
6
def print_hi(name):
    print(f'Hi,{name}')


if __name__ == '__main__':
    print_hi('PyCharm') # (1)!