Python ——1.2 基础语法发表时间:2022-04-16 21:47 Python 基础语法 Python 语言与 Perl,C 和 Java 等语言有许多相似之处。但是,也存在一些差异。 第一个 Python 程序 交互式编程不需要创建脚本文件,是通过 Python 解释器的交互模式进来编写代码。 linux上你只需要在命令行中输入 Python 命令即可启动交互式编程,提示窗口如下: $ python Python 2.7.6 (default, Sep 9 2014, 15:04:36) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> Window 上在安装 Python 时已经安装了交互式编程客户端,提示窗口如下:
在 python 提示符中输入以下文本信息,然后按 Enter 键查看运行效果: >>> print ("Hello, Python!") 在 Python 2.7.6 版本中,以上实例输出结果如下: Hello, Python!
文章分类:
信息技术-教学资源
|