Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please, need help for Python question. Answer: 2. 10. What is the technical term

ID: 643517 • Letter: P

Question

Please, need help for Python question.

Answer:

2.

10. What is the technical term for the errors that are found while a script it running, for example NameError?

Answer:

Give the error message: What is the name of the error that occurred? Give the error message: What is the name of the script file that was run? Files can be opened in different modes. Select the mode available for opening text files in Python. Select one or more: Give the error message: What is the name of the file that contains the line where the error occurred? When reading files, how is the end-of-file indicated? That is, how can your script know that it has read to the end of the file? What is the name of the file method to read the contents of the files as a list of separate lines? Give the error message: On what line number did the error occur? What pair of Python keywords are used when recovering from a run-time error? Select one:

Explanation / Answer

1. open(FILENAME,OPENING MODE)

2. TypeError

3. The Script file that was run   args.py

4. (c. append) (e. write) (j. read)
   so final options are c,e and j

5. Name of the file that contains the line where error occured is work.py

6.

file = open("FILENAME",'r')
for line in file:
   if (line == ""):
       break
   else:
       // do the desired operation

7.

file = open("FILENAME",'r')
l = file.read()
so file.read is the method that reads content of file as list of separate line

8. Line on which error occur is 12.

9. a . try,except

10. no idea about 10th one