try: # đoạn code có thể gây ra lỗi pass except(TypeError, ZeroDivisionError): print(“Python Quiz”) Đoạn code sau thực hiện yêu cầu gì?

try:

# đoạn code có thể gây ra lỗi

pass

except(TypeError, ZeroDivisionError):

print(“Python Quiz”)

Đoạn code sau thực hiện yêu cầu gì?

A. In ra ‘ Python Quiz ‘ nếu có ngoại lệ xảy ra (không quan trọng là ngoại lệ gì).

B. In ra ‘ Python Quiz ‘ nếu không có ngoại lệ xảy ra.

C. In ra ‘ Python Quiz ‘ nếu một trong hai ngoại lệ TypeError và ZeroDivisionError xảy ra.

D. Chỉ in ra ‘ Python Quiz ‘ khi cả hai ngoại lệ TypeError và ZeroDivisionError cùng xảy ra

Hướng dẫn

Chọn C là đáp án đúng

 

Thư viện tài liệu12 Tháng bảy, 2023 @ 2:30 chiều

Đánh giá chủ đề này
How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site