Chuỗi tài liệu trong python javatpoint

Nó được chỉ định trong mã nguồn được sử dụng, giống như nhận xét, để ghi lại một đoạn mã cụ thể. Không giống như các bình luận mã nguồn thông thường, chuỗi tài liệu nên mô tả chức năng đó làm gì chứ không phải cách thức

Một chuỗi tài liệu nên trông như thế nào?

  • Dòng chuỗi tài liệu phải bắt đầu bằng chữ in hoa và kết thúc bằng dấu chấm
  • Dòng đầu tiên phải là một mô tả ngắn
  • Nếu có nhiều dòng hơn trong chuỗi tài liệu, thì dòng thứ hai phải để trống, tách phần tóm tắt khỏi phần còn lại của phần mô tả một cách trực quan
  • Các dòng sau phải là một hoặc nhiều đoạn văn mô tả quy ước gọi của đối tượng, tác dụng phụ của nó, v.v.

Khai báo Docstrings. Các chuỗi tài liệu được khai báo bằng cách sử dụng "'ba dấu nháy đơn"' hoặc """ba dấu nháy kép""" ngay bên dưới khai báo lớp, phương thức hoặc hàm. Tất cả các chức năng nên có một chuỗi tài liệu

Truy cập Tài liệu. Các chuỗi tài liệu có thể được truy cập bằng phương thức __doc__ của đối tượng hoặc sử dụng chức năng trợ giúp.
Các ví dụ dưới đây minh họa cách khai báo và truy cập một chuỗi tài liệu.

ví dụ 1. Sử dụng ba dấu nháy đơn




Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
27
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
28

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
30

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
1

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
2

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
4
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
5

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
7
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
8
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
9
Returns arg1 raised to power arg2.
0

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
7
Returns arg1 raised to power arg2.
2

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
7
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
8
Returns arg1 raised to power arg2.
6
Returns arg1 raised to power arg2.
0

Returns arg1 raised to power arg2.
8
Returns arg1 raised to power arg2.
9

đầu ra

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.

ví dụ 2. Sử dụng ba dấu ngoặc kép




Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
27
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
28

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
93

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
95

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
2

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
4
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
5

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
7
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
8
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
9
Returns arg1 raised to power arg2.
0

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
7
Returns arg1 raised to power arg2.
2

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
7
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
8
Returns arg1 raised to power arg2.
6
Returns arg1 raised to power arg2.
0

Returns arg1 raised to power arg2.
8
Returns arg1 raised to power arg2.
9

đầu ra

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.

Tài liệu một dòng

Như tên gợi ý, một chuỗi tài liệu nằm gọn trong một dòng. Chúng được sử dụng trong các trường hợp rõ ràng. Dấu ngoặc kép đóng cùng dòng với dấu ngoặc kép mở. Điều này có vẻ tốt hơn cho một lớp lót.
Ví dụ.




Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
27
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
95

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
97

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
2

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
4
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
271
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
272
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
272
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
274

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

_______07____1277

đầu ra

________số 8

Tài liệu nhiều dòng

Chuỗi tài liệu nhiều dòng bao gồm một dòng tóm tắt giống như chuỗi tài liệu một dòng, theo sau là một dòng trống, tiếp theo là mô tả phức tạp hơn. Dòng tóm tắt có thể cùng dòng với lời mở đầu hoặc dòng tiếp theo.
Ví dụ bên dưới hiển thị một chuỗi tài liệu nhiều dòng.




Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
27
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
279

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
281

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
283

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
286

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29____1289

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
291

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
294

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
296

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
281

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
4
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
303

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
7
Returns arg1 raised to power arg2.
2

đầu ra

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
9

Thụt lề trong Docstrings

Toàn bộ chuỗi tài liệu được thụt vào giống như dấu ngoặc kép ở dòng đầu tiên. Các công cụ xử lý chuỗi tài liệu sẽ loại bỏ một lượng thụt đầu dòng đồng nhất từ ​​dòng thứ hai và các dòng tiếp theo của chuỗi tài liệu, bằng với mức thụt đầu dòng tối thiểu của tất cả các dòng không trống sau dòng đầu tiên. Bất kỳ thụt đầu dòng nào trong dòng đầu tiên của chuỗi tài liệu [i. e. , cho đến dòng mới đầu tiên] là không đáng kể và bị xóa. Thụt lề tương đối của các dòng sau trong chuỗi tài liệu được giữ lại

Docstrings trong các lớp học

Hãy để chúng tôi lấy một ví dụ để chỉ ra cách viết các tài liệu cho một lớp và các phương thức của nó. trợ giúp được sử dụng để truy cập chuỗi tài liệu




Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
307
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
308

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
281

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
02

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
03

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
05

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
06
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
07

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
06
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
09

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
281

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
27
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
15____016
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
17

_______006____1281

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
06
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
21

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

_______006____1289

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
25
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
07

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
25
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
28

_______006____1281

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
29
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
27
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
34
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
16
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
36

_______006____1281

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
06
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
40

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

_______006____1289

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
44
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
45

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
46

_______006____1294

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
44
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
50

_______006____1281

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
06
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
55
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
56
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
16
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
58
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
59
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
60

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
06
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
62
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
56
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
16
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
65
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
59
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
67

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
06
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
4
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
71

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
6

Returns arg1 raised to power arg2.
8
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
74
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
75

Returns arg1 raised to power arg2.
8
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
77
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
78

đầu ra

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
19

Sự khác biệt giữa nhận xét Python và tài liệu

Tất cả các bạn chắc hẳn đã có ý tưởng về chuỗi tài liệu Python nhưng bạn đã bao giờ tự hỏi sự khác biệt giữa nhận xét và chuỗi tài liệu Python là gì chưa?. Chúng ta hãy nhìn vào chúng

Nhận xét Python là thông tin hữu ích mà nhà phát triển cung cấp để người đọc hiểu mã nguồn. Nó giải thích logic hoặc một phần của nó được sử dụng trong mã. Nó được viết bằng cách sử dụng ký hiệu

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
79

Ví dụ




Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
80

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
7____08
Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
83
Returns arg1 raised to power arg2.
0

đầu ra

Using __doc__:
Demonstrates triple double quotes
    docstrings and does nothing really.
Using help:
Help on function my_function in module __main__:

my_function[]
    Demonstrates triple double quotes
    docstrings and does nothing really.
9

Trong khi đó, Tài liệu Python như đã đề cập ở trên cung cấp một cách thuận tiện để liên kết tài liệu với các mô-đun, hàm, lớp và phương thức Python

Chủ Đề