RT1 MCQ
RT1 MCQ
True
False
Depends on Program
Depends on the computer system
2. Which of the following is an invalid identifier?
CS_class_XII
csclass12
_csclass12
12CS
3. The tiny inidividual unit in python program is known as ___________
Expression
Statement
Token
Comment
4. Which of the following not a token?
Comments
Identifiers
Literals
Operators
5. Which of the following are pre-defined or reserved words that convey a special meaning
in programming language?
Identifiers
Literals
Keywords
Operators
6. The different names given to different parts of a program is known as _________
Identifiers
Literals
Keywords
Operators
7. Which of the following literals must terminate in one line?
Single line Strings
Multi line strings
Numeric Literals
All of the above
8. To include non-graphic characters in python, which of the following is used?
Special Literals
Boolean Literals
Escape Character Sequence
Special Literal – None
9. The octal literal and hexadecimal literals start with which of the following symbols
resepctively?
O0 and X0
0O and 0X
Oct0 and Hex0
0o and 0x
10. Which of the following literal has either True or False value?
Special Literals
Boolean Literals
Numeric Literals
String Literals
11. Which of the following are symbols used for computation or logical comparison in a
program?
Identifiers
Literals
Keywords
Operators
12. Which of the following is correct statement to computer square of variable x in python?
x*2
x power 2
x ** 2
x // 2
13. If you want to display the values without decimal place after division, which of the
following symbol is used?
/
//
%
**
14. Which of the is a correct statement?
xyz = 10 100 1000
x y z = 10 100 1000
x, y, z = 10, 100, 1000
x y z= 10, 100, 1000
15. Which of the following are symbols used in programming languages to organize
statement structures and inidicate the rythm of the program?
Operators
Punctuators
Functions
Literals
16. In python, the single line comments starts with _______
/
//
#
”’
17. In python, the multiline comments starts with ________
/
//
#
”’
18. _______ are additional readable information to clarify the statement in python.
Comments
Expressions
Tokens
Flow of control
19. Which of the following is a group of statements which are part of another statement or
functions?
Expression
Statement
Block
Comment
20. All statements inside a block are inteded at same level.
True
False
Not necessarily
Depends on user’s choice
21. By default the input() function returns
Integer
Float
Boolean
String
22. If a function does not return a value then what value will be returned by python in a
function?
int
void
bool
none
23. The output of d= a + b % c is _________, if a = 12, b=5 and c=3.
14
2
5
17
24. Evaluate x % y // x, if x = 5, y = 4
1.0
0.0
0
1
25. Which of theese arithematic operator will evaluate first?
+
–
**
%
//
26. Which of these relational operator has highest operator precedence?
<
>=
<=
==
27. Which of the followiing logical operator will evaluate first?
and
or
not
is not
28. How a>b>c will be interpreted by python?
a>b or a>c
a>b not a>c
a>b and a>c
a>b && a>c
29. Which of the followoing statement is correct for and operator?
Python only evaluates the second argument if the first one is False
Python only evaluates the second argument if the first one is True
Python only evaluates True if any one argument is True
Python only evaluates False if any one argument is False
30. Which of the following forces an expression to be converted into specific type?
implicit type casting
mutable type casting
immutable type casting
explicit type casting
31. _____ are stored as individual characters in contiguous locations, with two-way index for
each location.
lists
tuples
strings
dictionaries
32. What is the output of – “5” + “5” ?
25
55
10
error
33. If n=”Hello” and user wants to assign n[0]=’F’ what will be the result?
It will replace the first character
It’s not allowed in Python to assign a value to individual character using index
It will replace the entire word Hello into F
It will remove H and keep rest of the characters
34. Which of the following operator can be used as replication operator?
+
*
**
/
35. Which point can be considered as difference between string and list?
Length
Indexing and Slicing
Mutability
Accessing inidividual elements
36. In list slicing, the start and stop can be given beyond limits. If it is then
reaise exception IndexError
raise exception ValueError
return elements falling between specified start and stop values
return the entire list
37. In list slicing negative index -1 refers to
first element
last element
second last element
second element
38. Which of the following operator cannot used with strings?
==
+
*
/
39. Ms. Hetvee is working on a string program. She wants to display last four characters of a
string object named s. Which of the following is statement is true?
s[4:]
s[:4]
s[-4:]
s[:-4]
40. The append() method adds an element at
first
last
specified index
at any location
41. Which of the following statement is true for extend() list method?
ads element at last
ads multiple elements at last
ads element at specified index
ads elements at random index
42. The statement del l[1:3] do which of the following task?
deletes elements 2 to 4 elements from the list
deletes 2nd and 3rd element from the list
deletes 1st and 3rd element from the list
deletes 1st, 2nd and 3rd element from the list
43. If l=[11,22,33,44], then output of print(len(l)) will be
4
3
8
6
44. Which of the following method is used to delete element from the list?
del()
delete()
pop()
All of theese
45. What will be the output of following code:
txt="Term 1"
print(txt*2)
a) Term 1 Term 2
b) Term 1Term 1
c) Term 1 2
d) TTeerrmm 11
46. What will be the output of:
txt="SQP2021"
if txt.isalnum()==True:
print("Term 1 sample paper is out now")
else:
print("Term 1 sample paper is not out till now")
a) Term 1 sample paper is not out till now
b) Term 1 sample paper is out now
c) SQP2021
d) Error
47. What will be the output of the following statement given:
txt="term 1. sample paper 2021"
print(txt.capitalize())
a) term 1. sample paper 2021
b) Term 1. Sample Saper 2021
c) Term 1. sample paper 2021
d) Term 1. Sample Paper 2021
48. Which of the following statement prints output as ‘B’?
a) char(66)
b) ord(‘B’)
c) char(66)
d) chr(66)
49. Which of the following statement(s) is/are correct?
a) Tuples can have only integer elements.
b) Tuples can have only string elements.
c) Tuples can have various types of elements.
d) Tuples can either integer or string, but not both at once.
50. Which of the following statement creates a tuple?
a) t=[1,,2,3,4]
b) t={1,2,3,4}
c) t=<1,2,3,4>
d) t=(1,2,3,4)
51. Which of the following statement is correct?
a) Tuples are mutable.
b) Tuples are immutable.
c) Tuples and lists are same.
d) All of these are correct.
52. What will be the output of the following code:
t=(4,5,6)
t1=t*2
print(t1)
a) (4,5,6,4,5,6)
b) (4,4,5,5,6,6)
c) (8,10,12)
d) None of the above
53. What will be the output of :
t=(4,5,6)
del t[1]
print(t)
a) (4,6)
b) ([4,6])
c) [4,6]
d) Error
54. Which of the following operation is supported in python with respect to tuple t?
a) t[1]=33
b) t.append(33)
c) t=t+t
d) t.sum()
55. Which of the following statements prints the output (4,5)?
print(t[:-1]) , print(t[0:2])
print(t[3]), print(t[:-3])
print(t[2:3]), print(3:2)
print(t[0,2]), print[2,3]
56. What will be the output of the following code:
t=(4,5,6,7,8,9,3,2,1)
print(t[5:-1])
a) (8,9,3,2,1)
b) (9,3,2)
c) (4,5,6,7)
d) (2,3,9)
Now next questions for MCQ Term 1 Computer Science Class 12 are based on dictionary topics.
57. Dictionaries are also known as ________.
a) mappings
b) hashes
c) associative arrays
d) all of the above
58. Dictionaries are _________ type of python.
a) Mutable
b) Immutable
c) simple
d) complex
59. Mr Subodh is working with a dictionary in python for his project. He wants to display the key,
value pair but confuse out of these statements, choose the correct statement for him:
a) dict.values()
b) disct.keys()
c) dict.keysvalues()
d) dict.items()
60. The fromkeys() method assigns ________ value to key in dictionary by default.
a) 0
b) None
c) Empty
d) Blank
61. Which one of the following is the correct statement for creating a dictionary for assigning a
day number to weekdays using short names?
a) d ={1:Mon,2:Tue,3:Wed,4:Thur}
b) d ={1:’Mon’,2:’Tue’,3:’Wed’,4:’Thur’}
c) d ={1;’Mon’,2;’Tue’,3;’Wed’,4;’Thur’}
d) d ={1-‘Mon’,2-‘Tue’,3-‘Wed’,4-‘Thur’}
62. Om is learning the concept of dictionary in python. He read something about a dictionary
related to a set of elements. But he forgot the term which type of set of elements, suggest from
the below-given options:
a) sorted
b) ordered
c) unordered
d) random
63. Eshika is trying to delete an element from the dictionary, but she is getting an error – “the
given key is not found in the dictionary”. Which of the following command she has used in the
python
a) del dict[key]
b) dict.pop(key)
c) dict.popitem(key)
d) remove dict[key]
64. Which of the following is the correct statement for checking the presence of a key in the
dictionary?
a) <key> in <dictionary_object>
a) <key> not in <dictionary_object>
c) <key> found in <dictionary_object>
d) a) <key> exists in <dictionary_object>
65. What will be the output of the following dictionary?
d={'South Africa':'Faf Du Plesis','India':'Virat Kohli','Pakistan':'Babar Azam','Australia':'Steve
Smith'}
print(d['Virat Kohli'])
a) India
b) India-Virat Kohli
c) Virat Kohli
d) KeyError
66. What will be the output of the following code?
a) True
b) False
c) Error
d) None
67. Predict the correct output for the following code:
dict={'Manthan':34,'Vishwa':45,'Mayank':50}
print(dict[0])
a) Manthan:34
b) 34
c)Manthan
d) Error
68. Marks in the above-created dictionary are changed after rechecking, where Vishwa got 48
marks and Mayank got 49 marks. Choose the correct statement for the same:
a) dict.change({‘Vishva’:48,’Mayank’:49})
b) dict.alter({‘Vishva’:48,’Mayank’:49})
c) dict.update({‘Vishva’:48,’Mayank’:49})
d) dict.loc({‘Vishva’:48,’Mayank’:49})
69. What happens when the following statement will be written for the same dictionary created in
Que. No. 67?
dict.update({'Sameer':44})
a) It will raise an error – KeyError
b) It will add a new key and value at the end of the dictionary
c) It will replace the last key and value with the given key and value
d) It will add a new key and value at the beginning of the dictionary
70. Which of the following code will print output as 3 for the dictionary created in Que. No. 67?
a) print(dict.size)
b) print(size(dict))
c) print(length(dict))
d) print(len(dict))
71. What will be the output of the following code?
dict={'x':11,'y':13,'z':15}
s=""
for i in dict:
s=s+str(dict[i])+" "
s1=s[:-1]
print(s1[::-1])
a) 15 13 11
b) 11 13 15
c) 51 31 11
d) 10 13 14