Section A – Multiple Choice Questions (1 mark each)
- State True or False: Identifiers are names used to identify a variable, function in a program.
- Which of the following is a valid keyword in Python?
a) false b) return c) non_local d) none
- Given the following Tuple: Tup = (10, 20, 30, 50), which of the following statements will result in an error?
a) print(Tup[0]) b) Tup.insert(2,3) c) print(Tup[1:2]) d) print(len(Tup))
- Consider the given expression: 5<10 and 12>7 or not 7>4. What will be the correct output if the given expression is evaluated?
a) True b) False c) NONE d) NULL
- Select the correct output of the following code:
S = "Amrit Mahotsav@ 75" A = S.partition(" ") print(A)
a) (‘Amrit Mahotsav’, ‘@’, ’75’) b) [‘Amrit’, ‘Mahotsav’, ‘@’, ’75’] c) (‘Amrit’, ‘Mahotsav@ 75’) d) (‘Amrit’, ‘Mahotsav@ 75′, ’75’)
- Which of the following mode keeps the file offset position at the end of the file?
a) r+ b) r c) w d) a
- Which function is used to arrange the elements of a list in ascending order?
a) sort() b) arrange() c) ascending() d) asort()
- Which of the following operators will return either True or False?
a) += b) != c) = d) *=
- Which statement(s) would give an error after executing the following code?
Stud = {"Murugan": 100, "Mithu": 95} print(Stud[95])
a) Statement 2 b) Statement 3 c) Statement 4 d) Statements 2 and 4
- ___ is the number of tuples in a relation.
a) Attribute b) Degree c) Domain d) Cardinality
- The syntax of seek() is: file object.seek(offset[, reference_point]). What is the default value of the reference point?
a) 0 b) 1 c) 2 d) 3
- ___ clause is used with the SELECT statement to display data in a sorted form with respect to a specified column.
a) WHERE b) ORDER BY c) HAVING d) DISTINCT
- ___ communication is used for point-to-point communication such as radar and satellite.
a) INFRARED WAVES b) BLUETOOTH c) MICROWAVES d) RADIOWAVES
- What will the following expression evaluate to?
print(4 + 3 * 5 / 3 - 5 % 2)
a) 8.5 b) 8.0 c) 10.2 d) 10.0
- Which function returns the sum of all elements of a list?
a) count() b) sum() c) total() d) add()
- fetchall() method fetches all rows in a result set and returns a:
a) Tuple of lists b) List of tuples c) List of strings d) Tuple of strings
- Assertion (A): To use a function from a particular module, we need to import the module.
Reason (R): import statement can be written anywhere in the program, before using a function from that module.
a) Both (A) and (R) are true and (R) is the correct explanation for (A).
b) Both (A) and (R) are true and (R) is not the correct explanation for (A).
c) (A) is true but (R) is false.
d) (A) is false but (R) is true.
- Assertion (A): A stack is a LIFO structure.
Reason (R): Any new element pushed into the stack always gets positioned at the index after the last existing element in the stack.
a) Both (A) and (R) are true and (R) is the correct explanation for (A).
b) Both (A) and (R) are true and (R) is not the correct explanation for (A).
c) (A) is true but (R) is false.
d) (A) is false but (R) is true.