with Correct Answers
Which of the following is associated with a specific file and provides a way for the
program to work with that file?
A)
the file variable
B)
the file object
C)
the filename
D)
the file extension - Answer-B
Which method could be used to convert a numeric value to a string?
A)
value
B)
chr
C)
num
D)
str - Answer-D
Which step creates a connection between a file and a program?
A)
read the file
B)
process the file
C)
open the file
D)
close the file - Answer-C
Which list will be referenced by the variable number after the following code is
executed?number = range(0, 9, 2)
A)
[0, 2, 4, 6, 8]
B)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
, C)
[1, 3, 5, 7, 9]
D)
[2, 4, 6, 8] - Answer-A
Which method can be used to convert a list to a tuple?
A)
list
B)
tuple
C)
insert
D)
append - Answer-B
Which of the following would you use if an element is to be removed from a specific
index?
A)
a del statement
B)
a slice method
C)
an index method
D)
a remove method - Answer-A
Which method can be used to convert a tuple to a list?
A)
append
B)
insert
C)
tuple
D)
list - Answer-D
The first line in a function definition is known as the function - Answer-header
When a function is called by its name during the execution of a program, then it is -
Answer-executed
What type of function can be used to determine whether a number is even or odd?
A)
Boolean
B)
math