Python练习:安装与运行

编程题

请大家根据教程下载安装 Python 解释器。

安装好以后,请大家写一段代码

在屏幕上打印出

hello world
你好,世界

这2行代码 先在Python交互式命令行中运行。

再将代码存入文件,用Python解释器去执行该文件。


答案视频讲解

请大家点击此处链接,观看讲解视频



判断题

PRINT('Hello world')

答案视频讲解


请大家点击此处链接,观看讲解视频



问答题

d:\>python my.py
'python' 不是内部或外部命令,也不是可运行的程序
或批处理文件。



d:\>python my.py
python: can't open file 'my.py': [Errno 2] No such file or directory



d:\>python
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> python my.py
  File "<stdin>", line 1
    python my.py
            ^
SyntaxError: invalid syntax
>>>



>>>  print('hello')
  File "<stdin>", line 1
    print('hello')
    ^
IndentationError: unexpected indent
>>>



>>>Print('hello')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Print' is not defined
>>>


答案视频讲解


请大家点击此处链接,观看讲解视频

您需要高效学习,找工作? 点击这里 白月黑羽实战班