─────────────────────────────────────────────────────────┐
│Windows PowerShell - □ x │
├─────────────────────────────────────────────────────────┤
│Windows PowerShell │
│Copyright (C) Microsoft Corporation. All rights reserved.│
│ │
│PS C:\Users\liaoxuefeng> │
│ │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│Windows PowerShell - □ x │
├─────────────────────────────────────────────────────────┤
│Windows PowerShell │
│Copyright (C) Microsoft Corporation. All rights reserved.│
│ │
│PS C:\Users\liaoxuefeng> python │
│Python 3.x ... on win32 │
│Type "help", ... for more information. │
│>>> _ │
│ │
└─────────────────────────────────────────────────────────┘
To exit the Python interactive mode and return to the command-line mode, type exit() and press Enter.
┌─────────────────────────────────────────────────────────┐
│Windows PowerShell - □ x │
├─────────────────────────────────────────────────────────┤
│Windows PowerShell │
│Copyright (C) Microsoft Corporation. All rights reserved.│
│ │
│PS C:\Users\liaoxuefeng> python │
│Python 3.x ... on win32 │
│Type "help", ... for more information. │
│>>> exit() │
│ │
│PS C:\Users\liaoxuefeng> │
└─────────────────────────────────────────────────────────┘
You can also directly enter the Python interactive mode by selecting the “Python (command line)” menu item from the Start menu. However, after typing exit(), the window will close immediately and will not return to the command-line mode.

>>> 100+200
300
>>> print('hello, world')
hello, world
Such text enclosed in single or double quotes is called a string in the program, and we will encounter it frequently in the future.
┌─────────────────────────────────────────────────────────┐
│Windows PowerShell - □ x │
├─────────────────────────────────────────────────────────┤
│Windows PowerShell │
│Copyright (C) Microsoft Corporation. All rights reserved.│
│ │
│PS C:\Users\liaoxuefeng> python hello.py │
│python: can't open file 'hello.py': [Errno 2] No such │
│file or directory │
│ │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│Windows PowerShell - □ x │
├─────────────────────────────────────────────────────────┤
│Windows PowerShell │
│Copyright (C) Microsoft Corporation. All rights reserved.│
│ │
│PS C:\Users\liaoxuefeng> cd work │
│PS C:\Users\liaoxuefengwork> python hello.py │
│Hello, world! │
│ │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│Windows PowerShell - □ x │
├─────────────────────────────────────────────────────────┤
│Windows PowerShell │
│Copyright (C) Microsoft Corporation. All rights reserved.│
│PS C:\Users\liaoxuefeng> D: │
│PS D:\> cd work │
│PS D:\work> │
│ │
└─────────────────────────────────────────────────────────┘
>>> 100 + 200 + 300
600
100 + 200 + 300
C:\work>python calc.py
print(100 + 200 + 300)
C:\work>python calc.py
600
>>> print('hello')
File "<stdin>", line 1
print('hello')
^
SyntaxError: invalid character '(' (U+FF08)
“ and ”:>>> print(“hello”)
File "<stdin>", line 1
print(“hello”)
^
SyntaxError: invalid character '“' (U+201C)