使用gedit写下如下代码:
- print “Hello World!”
- print “Hello Again”
- print “I like typing this.”
- print “This is fun.”
- print ‘Yay! Printing.’
- print “I’d much rather you ‘not’.”
- print ‘I “said” do not touch this.’
将其命名为ex1.py。注意该命名方式,Python文件都以.py结尾。
将其保存到PowerShell命令行$所显示的目录下。打开PowerShell,输入:
python ex1.py
就可以看到程序的运行结果: