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

Multiple Choice 1. A file that data is written to is known as a(n) a. input file

ID: 3694489 • Letter: M

Question

Multiple Choice

1. A file that data is written to is known as a(n)

a. input file.

b. output file.

c. sequential access file.

d. binary file.

2. A file that data is read from is known as a(n)

a. input file.

b. output file.

c. sequential access file.

d. binary file.

3. Before a file can be used by a program, it must be

a. formatted.

b. encrypted.

c. closed.

d. opened.

4. When a program is finished using a file, it should do this.

a. erase the file

b. open the file

c. close the file

d. encrypt the file

5 . The contents of this type of file can be viewed in an editor such as Notepad.

a. text file

b. binary file

c. English file

d. human-readable file

6. This type of file contains data that has not been converted to text.

a. text file

b. binary file

c. Unicode file

d. symbolic file

7. When working with this type of file, you access its data from the beginning of the file to the end of the file.

a. ordered access

b. binary access

c. direct access

d. sequential access

8. When working with this type of file, you can jump directly to any piece of data in the file without reading the data that comes before it.

a. ordered access

b. binary access

c. direct access

d. sequential access

9. This is a small “holding section” in memory that many systems write data to before writing the data to a file.

a. buffer

b. variable

c. Virtual file

d. temporary file

True or False

10. When working with a sequential access file, you can jump directly to any piece of data in the file without reading the data that comes before it.

11. When you open a file that file already exists on the disk using the 'w' mode, the contents of the existing file will be erased.

12. The process of opening a file is only necessary with input files. Output files are automatically opened when data is written to them.

13. When an input file is opened, its read position is initially set to the first item in the file.

14. When a file that already exists is opened in append mode, the file’s existing contents are erased.

Multiple Choice

15. This term refers to an individual item in a list.

a. element

b. bin

c. cubbyhole

d. slot

16. This is a number that identifies an item in a list.

a. element

b. index

c. bookmark

d. identifier

17. This is the first index in a list.

a. —1

b. 1

c. 0

d. The size of the list minus one

18. This is the last index in a list.

a. 1

b. 99

c. 0

d. The size of the list minus one

19. This Will happen if you try to use an index that is out of range for a list.

a. A ValueError exception will occur.

b. An IndexError exception will occur.

c. The list will be erased and the program will continue to run.

d. Nothing - the invalid index will be ignored.

20. This function returns the length of a list.

a. length

b. size

c. len

d. lengthof

21. When the * operator’s left operand is a list and its right operand is an integer, the operator becomes this.

a. The multiplication operator

b. The repetition operator

c. The initialization operator

d. Nothing - the operator does not support those types of operands.

22. This is the first index in a string.

a. -1

b. 1

c. 0

d. The size of the string minus one

23. This is the last index in a string.

a. 1

b. 99

c. 0

d. The size of the string minus one

24. This will happen if you try to use an index that is out of range for a string.

a. A ValueError exception will occur.

b. An IndexError exception will occur.

c. The string will be erased and the program will continue to run.

d. Nothing - the invalid index will be ignored.

25. This function returns the length of a string.

a. length

b. size

c. len

d. lengthof

26. This string method returns a copy of the string with all leading whitespace characters removed.

a. lstrip

b. rstrip

c. remove

d. strip_leading

27. This string method returns the lowest index in the string where a specified substring is found.

a. first_index_of

b. locate

C. find

d. index_of

28. This operator determines whether one string is contained inside another string.

a. contains

b. is_in

c. ==

d. in

29. This string method returns true if a string contains only alphabetic characters and is at least one character in length.

a. the isalpha method

b. the alpha method

c. the alphabetic method

d. the isletters method

30. This string method returns true if a string contains only numeric digits and is at least one character in length.

a. the digit method

b. the isdigit method

c. the numeric method

d. the isnumber method

Explanation / Answer

i am not sue wih 3 bits remaing i answrd

1)
b
2)
a
3)
d
4)
c
5)
a
6)
b)
7)
d
8)
c
9)
a
10)
false
11)
true
12)
false
13)
true
14)
false
15)
a
16)
b)
17)
c
18)
d
19)
b
20)
c
21)
b
30)
b
29)
b
28)
d
27)
c
26)
d