QUESTION 2
This is a MULTIPLE ANSWER question, which means you are able to select one or more answers as being correct. Note that this does not necessarily mean that there are multiple correct answers. In any case, select all the answers you believe are correct. (NB: There are no part marks awarded for multiple answer questions.)
This question is designed to test your ability to find and interpret Python documentation.
There is a Python function shown in the Python documentation as follows:
open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None,closefd=True, opener=None)
Which of the following are built-in functions (methods) that can be used on the value that is returned from a successful call to the open function (assuming the appropriate mode is used)?
close |
||
tell |
||
write |
||
read |
||
seek |
Solution:
The open() function returns a file object which can used to read, write and modify file. Here, 'r' mode is used which means 'open a file for reading only'.
Following are built-in functions (methods) that can be used on the value that is returned from a successful call to the open function in 'r' mode:
close() : The close() method is used to close the file, close method clear all buffer and close the file.
read() : The read() method just outputs the entire file if number of bytes are not given in the argument.
Please give thumbsup, if you like it. Thanks.
QUESTION 2 This is a MULTIPLE ANSWER question, which means you are able to select one...
IT PYTHON QUESTION1 Consider the following Python code, where infile.txt and outfile.txt both exist in the current directory 'z' ) 。1d = open ( ' infile. txt ' , for line in old: new.write (line) new.write') ne«.close () old.close) Which of the following options best describes the purpose or outcome of this code? O A copy of the file infile.txt is made (except in double line spacing) and saved as outfile.txt in the current directory. O A copy of the...
QUESTION 3 This is a MULTIPLE ANSWER question, which means you are able to select one or more answers as being comect. Note that this does not necessarily mean that thete are multiple cortect answers. In any case, select all the answers you believe are correct NB: There are no part marks awarded for multiple answer questions.) There is a Python list called data set. Each element of data_set is a triple (ie, three integers), specifying certain properties for drawing...
Question Completion Status: This is a MULTIPLE ANSWER question, which means you are able to select one or more answers as being mean that there are multiple correct answers. In any case, select all the answers you believe are correct one use for regular expressions is to define concisely all the patterns that belong to a particular language formed f symbols. Consider the regular expression: correct. Note that this c Which of the following phrases do NOT belong tin full...
QUESTION 2 Boolean or "truth-valued" expressions are how we express conditions that control choices and repetition in computer languages. Consider the following Python Boolean expression, where variables alpha, beta, and gamma are of type Boolean: alpha and (beta or gamma) In any algebraic notation there are usually several different ways of writing the same expression. For instance, in integer arithmetic the value of expression '4 x (5 + 2)' is numerically equivalent to that of expression '(4 x 5) +...
Question 17 Which of the following is true regarding audit documentation? (Select the correct answer.) a. Documentation must be in paper form in the audit work papers. b. Audit documentation would identify who prepared the work paper but does not need to identify who reviewed the work paper. c. Audit documentation provides the principal support for the audit opinion expressed by the auditor. d. Auditors document only those significant issues unresolved at the conclusion of the audit. Question 18 Which...
Answer the following multiple-choice question. You have to select the correct option and provide a complete correct solution. b. A small pump costs $20,000 and has a life of eight years. The pump will have a $4,000 SV at that time. If the 150% DB method is used to depreciate the pump, the BV at the end of year five is approximately equal to i. $5,000 ii. $6,000 iii. $7,000 iv. $8,000
MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) One of the objectives of the bank reconciliation is: A) Pay bills 1) B) Insure the debits equal credits D) None of the choices are correct C) Detect errors 2) When reconciling the bank statement using QuickBooks: A) All deposits listed on the bank statement are selected as cleared in the Reconcile window 2) B) Interest earned is subtracted C) Service charges are added...
Q1. For each part of this question, select one correct answer 3 points each). a. Statement: When estimating a regression with a binary dependent variable, it is necessary to use heteroseedasticity-robust standard error estimates to test hypotheses about the regression coefficients A Agree B. Disagree b. Statement: If MLR.5 is violated, we can still use the salt and F statistics when the sample size is large enough. A. Agree B. Disagree c. Statement: Suppose that the dependent variable in your...
Question 1 Each one of the multiple choice questions is worth 3.5 points 1. Which one of the following is correct about D'Arsonvals E. DC sensitivity is 3462/V and the required multiplier resis tance is 207.6kN which must be connected in series with the D'Arsonval A. the deflection stops in D'Arsonvals due to restoring torque produced by control spring. The unit of control spring con- stant is Nm B. the deflection stops in D'Arsonvals due to deflection torque produced by...
need help for solve multiple choice question... 1.The employee summary report option shows Select one: a. earnings and deductions from a paycheque b. all information entered in employee records c. wage or salary amounts d. all year-to-date totals 2.In the process of correcting a wrong employee error all but one is used – Select one: a. prepare a new entry for the correct employee b. one should remember to recalculate the taxes c. open the adjust cheque window for the...