CBSE Class 12 Computer Science — MCQs
Multiple choice questions from all previous year papers.
16 questions found
2026(16 questions)
- 2
Identify the output of the following code snippet : ```python s = "the Truth" print(s.capitalize()) ```
1 mark· A· String Methods — capitalize() - 3
Which of the following expressions in Python evaluates to True ?
1 mark· A· Logical Operators (and) - 4
What is the output of the following code snippet ? ```python s='War and Peace by Leo Tolstoy' print(s.partition("by")) ```
1 mark· A· String Methods — partition() - 8
If L is a list with 6 elements, then which of the following statements will raise an exception ?
1 mark· A· Lists — pop() and insert() Methods - 10
Consider the statement given below : ```python f1 = open("pqr.dat","________") ``` Which of the following is the correct file mode to open the file in read only mode ?
1 mark· A· File Handling - File Opening Modes - 14
What will be the output of the query ? ```sql SELECT MACHINE_ID, MACHINE_NAME FROM INVENTORY WHERE QUANTITY <= 100; ```
1 mark· A· SQL SELECT with WHERE Clause - 18
Which network device serves as the entry and exit point of a network, as all data coming in or going out of a network must first pass through it in order to use routing paths ?
1 mark· A· Network Devices — Gateway - 6
What will be the output of the following code snippet ? ```python t = tuple('tuple') t2 = t[2], t += t2 print(t) ```
1 mark· A· Tuples — Indexing and Concatenation - 7
Which of the following statements is true about dictionaries in Python ?
1 mark· A· Dictionaries — Key Properties - 9
What will be the output of the following code ? ```python def f1(a,b=1): print(a+b,end='-') c=f1(1,2) print(c,sep='*') ```
1 mark· A· Functions - Default Arguments & Return Value - 13
Which of the following SQL command can change the degree of the existing relation ?
1 mark· A· SQL DDL - ALTER TABLE - 16
Which aggregate function in SQL returns the smallest value from a column in a table ?
1 mark· A· SQL Aggregate Functions - 17
With respect to computer networks, which of the following is the correct expanded form of RJ 45 ?
1 mark· A· RJ-45 Connector - 47
For the academic purpose, the University will provide its own 24 x 7 FM channel within the University Campus. Which communication medium, out of the following, is used by FM ?
1 mark· E· Wireless Transmission Media — Radio Waves - 12
A table has two candidate keys, one of which is chosen as the primary key. How many alternate keys does this table have ?
1 mark· A· Candidate, Primary & Alternate Keys - 15
A relation in MySQL database consists of 2 tuples and 3 attributes. If 2 attributes are deleted and 4 tuples are added, what will be the cardinality of the relation ?
1 mark· A· Degree and Cardinality of a Relation