Python learning record -Hello Word

The software is installed to start learning to write code for it.

 Code:

 

 

operation result:

 

 

1. Open a command window (Windows + R cmd), hit Enter Python

 

 

2 dozen quit () Enter

 

 

3 dozen D: Enter

md code Enter (Create Folder)

Enter cd code (open folder)

 

4. The computer is on the D drive, enter the code folder, right-New 1.py (can create a text document, and then change the suffix name)

 

 

5. Open with nodepad ++ 1.py, input print ( "Hello Word")

 

 You can also use this to open the Edit

 

6. window switching command to play Python 1.py (when the front space 1) Enter

(Coding format of the first line of the document file 1.py

print ( "This is the Chinese"), if problems, insert a row in 1.py the top # - * - coding: utf-8 - * -)

 

 

7. Enter print ( "This is the Chinese \ n" * 80) 80 to 1 billion will be problems, as shown below (the latter number by the number of printed representation)

 

 

 

8 command window closes, and then how to open this location

Python-quit()-D:-cd code

 

 

 

9.1.py

print("Hello Word!")
print("Hello Again")
print("I like typing this.")
print("这是中文\n"*1)
print("This is fun.")
print('Yay!Printing.')
print("I'd much rather you 'not'.")
print('I "said" do not touch this.')

Output:

 

 

10. Common command

 cls 清屏

F3重复上一条命令

format 格式化(不要随便玩,会弄丢文件)

 

Guess you like

Origin www.cnblogs.com/WalkingSnail/p/11239806.html