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:
You create the following code. Line numbers are included for reference only.
Which code should you write for line 05 and line 06?
You are creating a function that reads a data file and prints each line of the file.
You write the following code. Line numbers are included for reference only.
The code attempts to read the file even if the file does not exist.
You need to correct the code.
Which three lines have indentation problems? Each correct answer presents part of the solution. (Choose three.)
You are creating a function that manipulates a number. The function has the following requirements:
Which two math functions should you use? Each correct answer is part of the solution? (Choose two.)
You are developing a Python application for your company.
You write the following code:
Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
You are writing a Python program to perform arithmetic operations.
You create the following code:
What is the result of each arithmetic expression? To answer, drag the appropriate expression from the column on the left to its result on the right. Each expression may be used once, more than once, or not at all.
The ABC Video company needs a way to determine the cost that a customer will pay for renting a DVD. The cost is dependent on the time of day the DVD is returned. However, there are also special rates on Thursdays and Sundays. The fee structure is shown in the following list:
You need to write code to meet the requirements.
How should you complete the code? To answer, select the appropriate code segments in the answer area.