Câu 8: 98-381: Introduction to Programming Using Python
You are writing a Python program to automate inventory. Your first task is to read a file of inventory transactions. The file contains sales from the previous day, including the item id, price, and quantity. The following shows a sample of data from the file: The code must meet the following requirements: ✑ Each line…
Nội dung câu hỏi
You are writing a Python program to automate inventory. Your first task is to read a file of inventory transactions. The file contains sales from the previous day, including the item id, price, and quantity. The following shows a sample of data from the file: The code must meet the following requirements: ✑ Each line of the file must be read and printed ✑ If a blank line is encountered, it must be ignored ✑ When all lines have been read, the file must be closedYou create the following code. Line numbers are included for reference only. Which code should you write for line 05 and line 06?
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
-
A. Lựa chọn A bằng hình ảnh — đáp án hiện tại
-
B. Lựa chọn B bằng hình ảnh
-
C. Lựa chọn C bằng hình ảnh
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.