Hướng dẫn Python

TRANG CHỦ Python Giới thiệu Python Python Bắt đầu Cú pháp Python Nhận xét Python Biến Python Các kiểu dữ liệu Python Số Python Đúc Python Chuỗi Python Python Booleans Toán tử Python Danh sách Python Python Tuples Bộ Python Từ điển Python Python Nếu ... Khác Python While Loops Python cho các vòng lặp Các hàm Python Python Lambda Mảng Python Các lớp / đối tượng Python Kế thừa Python Trình lặp lại Python Phạm vi Python Mô-đun Python Ngày trong Python Toán Python JSON Python Python RegEx Python PIP Python Thử ... Ngoại trừ Đầu vào của người dùng Python Định dạng chuỗi Python

Xử lý tập tin

Xử lý tệp Python Tệp đọc Python Viết / tạo tệp trong Python Xóa tệp trong Python

Mô-đun Python

Hướng dẫn NumPy Panda Walkthrough Hướng dẫn Scipy

Python Matplotlib

Giới thiệu Matplotlib Matplotlib Bắt đầu Matplotlib Pyplot Matplotlib Plotting Điểm đánh dấu Matplotlib Dòng Matplotlib Nhãn Matplotlib Matplotlib Grid Matplotlib Subplots Matplotlib Scatter Matplotlib Bars Biểu đồ Matplotlib Biểu đồ bánh Matplotlib

Học máy

Bắt đầu Chế độ trung bình trung bình Độ lệch chuẩn Phân vị Phân phối dữ liệu Phân phối dữ liệu bình thường Lô phân tán Hồi quy tuyến tính Hồi quy đa thức Nhiều hồi quy Tỉ lệ Huấn luyện / Kiểm tra Cây quyết định

Python MySQL

MySQL Bắt đầu MySQL Tạo cơ sở dữ liệu MySQL Tạo bảng Chèn MySQL Lựa chọn MySQL MySQL ở đâu MySQL Đặt hàng bởi MySQL Delete Bảng thả MySQL Cập nhật MySQL Giới hạn MySQL Tham gia MySQL

Python MongoDB

MongoDB Bắt đầu MongoDB Tạo cơ sở dữ liệu MongoDB Tạo Bộ sưu tập Chèn MongoDB MongoDB Tìm Truy vấn MongoDB MongoDB sắp xếp MongoDB Xóa MongoDB Drop Collection Cập nhật MongoDB Giới hạn MongoDB

Tham khảo Python

Tổng quan về Python Các hàm tích hợp trong Python Phương thức chuỗi Python Phương thức danh sách Python Phương thức từ điển Python Phương thức Tuple trong Python Phương thức tập hợp Python Phương thức tệp Python Từ khóa Python Ngoại lệ Python Bảng chú giải thuật ngữ Python

Tham chiếu mô-đun

Mô-đun ngẫu nhiên Mô-đun yêu cầu Mô-đun thống kê Mô-đun Toán học Mô-đun cMath

Python Làm thế nào để

Xóa danh sách trùng lặp Đảo ngược một chuỗi Thêm hai số

Ví dụ Python

Ví dụ Python Trình biên dịch Python Bài tập Python Python Quiz Chứng chỉ Python

Các ngoại lệ tích hợp trong Python


Các ngoại lệ tích hợp

Bảng dưới đây cho thấy các ngoại lệ tích hợp sẵn thường được nêu ra trong Python:

Exception Description
ArithmeticError Raised when an error occurs in numeric calculations
AssertionError Raised when an assert statement fails
AttributeError Raised when attribute reference or assignment fails
Exception Base class for all exceptions
EOFError Raised when the input() method hits an "end of file" condition (EOF)
FloatingPointError Raised when a floating point calculation fails
GeneratorExit Raised when a generator is closed (with the close() method)
ImportError Raised when an imported module does not exist
IndentationError Raised when indendation is not correct
IndexError Raised when an index of a sequence does not exist
KeyError Raised when a key does not exist in a dictionary
KeyboardInterrupt Raised when the user presses Ctrl+c, Ctrl+z or Delete
LookupError Raised when errors raised cant be found
MemoryError Raised when a program runs out of memory
NameError Raised when a variable does not exist
NotImplementedError Raised when an abstract method requires an inherited class to override the method
OSError Raised when a system related operation causes an error
OverflowError Raised when the result of a numeric calculation is too large
ReferenceError Raised when a weak reference object does not exist
RuntimeError Raised when an error occurs that do not belong to any specific expections
StopIteration Raised when the next() method of an iterator has no further values
SyntaxError Raised when a syntax error occurs
TabError Raised when indentation consists of tabs or spaces
SystemError Raised when a system error occurs
SystemExit Raised when the sys.exit() function is called
TypeError Raised when two different types are combined
UnboundLocalError Raised when a local variable is referenced before assignment
UnicodeError Raised when a unicode problem occurs
UnicodeEncodeError Raised when a unicode encoding problem occurs
UnicodeDecodeError Raised when a unicode decoding problem occurs
UnicodeTranslateError Raised when a unicode translation problem occurs
ValueError Raised when there is a wrong value in a specified data type
ZeroDivisionError Raised when the second operator in a division is zero