下面是使用pycharm编辑器开发Python程序的方法
注意:每当你需要提供 命令行参数(Command Line Arguments)时,点击 Run -> Edit Configurations 并在 Script parameters: 部
分输入相应参数,并点击 OK 按钮:
对于其他编辑器用户打开你选择的编辑器。
输入案例中给出的代码。
以给定的文件名将其保存成文件。
在解释器中通过命令 python program.py 来运行程序。
案例:使用变量与字面常量
输入并运行以下程序:# 文件名:var.py
i = 5
print(i)
i = i + 1
print(i)
s = '''This is a multi-line string.
This is the second line.'''
print(s)
输出:5
6
This is a multi-line string.
This is the second line.