Teachers and Examiners (CBSESkillEduction) collaborated to create the Python Revision Tour 2 Class 12 MCQ. All the important Information are taken from the NCERT Textbook Computer Science (083) class 12.
Python Revision Tour 2 Class 12 MCQ
1. _________ is a sequence which is made up of one or more UNICODE characters.
a. String
b. Number
c. Float
d. Double
Show Answer ⟶Hide Answer ⟵a. String
2. String can be a _________.
a. Letter
b. Digit
c. Whitespace & Symbol
d. All of the above
Show Answer ⟶Hide Answer ⟵d. All of the above
3. A string can be assign by enclosing ______ quote.
a. Single
b. Double
c. Triple
d. All of the above
Show Answer ⟶Hide Answer ⟵d. All of the above
4. Each individual character in a string can be accessed using a technique called _______.
a. Indexing
b. Method
c. Storing
d. None of the above
Show Answer ⟶Hide Answer ⟵a. Indexing
5. The index specifies the character to be accessed in the string and is written in square brackets _______.
a. ( )
b. [ ]
c. { }
d. None of the above
Show Answer ⟶Hide Answer ⟵b. [ ]
6. In the string, the index of the first character start from ______.
a. 0
b. n-1
c. 1
d. None of the above
Show Answer ⟶Hide Answer ⟵a. 0
7. In the string, the index of the last character ______.
a. 0
b. n-1
c. 1
d. None of the above
Show Answer ⟶Hide Answer ⟵b. n-1
8. If we give index value out of this range then we get an _______.
a. Run time Error
b. IndexError
c. Syntax Error
d. None of the above
Show Answer ⟶Hide Answer ⟵b. IndexError
9. What will be the output of the following python code
str1=”Welcome to my \n School”
print(str1)
a. Welcome to my
b. Welcome to my School
c. Welcome to my
School
d. None of the above
Show Answer ⟶Hide Answer ⟵c. Welcome to my
10. What will be the output of the following python code
str1=”Welcome to \
my School”
print(str1)
a. Welcome to my School
b. Welcome to
my School
c. Welcome to \ my School
d. None of the above
Show Answer ⟶Hide Answer ⟵a. Welcome to my School
11. A string is an _______ data type.
a. Mutable
b. Immutable t
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵b. Immutable
12. Immutable data type means _________.
a. String can be changed after it has been created
b. String cannot be changed after it has been created
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵b. String cannot be changed after it has been created
13. Concatenate means ______.
a. to Join
b. to Divide
c. to Split
d. None of the above
Show Answer ⟶Hide Answer ⟵a. to Join
14. Python allows us to join two strings using concatenation operator _______.
a. + +
b. + –
c. +
d. None of the above
Show Answer ⟶Hide Answer ⟵c. +
15. Python allows us to repeat the given string using repetition operator which is denoted by symbol _________.
a. *
b. &
c. #
d. $
Show Answer ⟶Hide Answer ⟵a. *
16. It is possible to retrieve each individual character in a string using a method _________ .
a. Concatenation
b. Indexing
c. Replication
d. All of the above
Show Answer ⟶Hide Answer ⟵b. Indexing
17. We receive a ________ if we provide an index value that is outside of the range.
a. Syntax Error
b. Run time Error
c. Index Error
d. None of the above
Show Answer ⟶Hide Answer ⟵c. Index Error
18. Python has two membership operators _______ and ______.
a. In and Out
b. In and Not
c. True and False
d. None of the above
Show Answer ⟶Hide Answer ⟵b. In and Not
19. The _________ operator also takes two strings and returns True if the first string does not appear as a substring in the second string, otherwise returns False.
a. Not
b. Not to
c. Not in
d. Not out
Show Answer ⟶Hide Answer ⟵c. Not in
20. In Python, to access some part of a string or substring, we use a method called _______.
a. Joining
b. Slicing
c. Accessing
d. None of the above
Show Answer ⟶Hide Answer ⟵b. Slicing
21. The data type list is an ordered sequence which is ________ and made up of one or more elements.
a. Mutable
b. Immutable
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵a. Mutable
22. Which statement from the list below will be create a new list?
a. new_l = [1, 2, 3, 4]
b. new_l = list()
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵c. Both a) and b)
23. List can content __________.
a. Integer
b. Float
c. String & Tuple
d. All of the above
Show Answer ⟶Hide Answer ⟵d. All of the above
24. list are enclosed in square ________ and are separated by _________.
a. Brackets and comma
b. Brackets and dot
c. Curli Brackets and dot
d. None of the above
Show Answer ⟶Hide Answer ⟵a. Brackets and comma
25. List elements may be of the following data types.
a. Different data types
b. Same data types
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵a. Different data types
26. In Python, lists are mutable. It means that ________.
a. The contents of the list can be changed after it has been created
b. The contents of the list can’t changed after it has been created
c. The list cannot store the number data type.
d. None of the above
Show Answer ⟶Hide Answer ⟵a. The contents of the list can be changed after it has been created
27. What will be the output of the following python code
print(list(“Python”))
a. (‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’)
b. [‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’]
c. (“P”, “y”, “t”, “h”, “o”, “n”)
d. [“P”, “y”, “t”, “h”, “o”, “n”]Show Answer ⟶Hide Answer ⟵
b. [‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’]
28. The data type list allows manipulation of its contents through ________.
a. Concatenation
b. Repetition
c. Membership
d. All of the above
Show Answer ⟶Hide Answer ⟵d. All of the above
29. Python allows us to join two or more lists using __________ operator.
a. Concatenation
b. Repetition
c. Membership
d. All of the above
Show Answer ⟶Hide Answer ⟵a. Concatenation
30. What will be the output of the following python code
new_list = [‘P’,’y’,’t’,’h’,’o’,’n’]
print(len(new_list))
a. 6
b. 7
c. 8
d. 9
Show Answer ⟶Hide Answer ⟵a. 6
31. Example of concatenation operator _______.
a. –
b. +
c. /
d. *
Show Answer ⟶Hide Answer ⟵b. +
32. If we try to concatenate a list with elements of some other data type, _________ occurs.
a. Runtime Error
b. Type Error
c. Result
d. None of the above
Show Answer ⟶Hide Answer ⟵b. Type Error
33. Python allows us to replicate a list using repetition operator depicted by symbol _________.
a. –
b. +
c. /
d. *
Show Answer ⟶Hide Answer ⟵d. *
34. Like strings, the membership operators _________ checks if the element is present in the list and returns True, else returns False.
a. In
b. Out
c. Listin
d. None of the above
Show Answer ⟶Hide Answer ⟵a. In
35. We can access each element of the list or traverse a list using a _______.
a. For loop
b. While loop
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵c. Both a) and b)
36. _________ returns the length of the list passed as the argument.
a. len()
b. length()
c. leth()
d. None of the above
Show Answer ⟶Hide Answer ⟵a. len()
37. ________ creates an empty list if no argument is passed.
a. len()
b. list()
c. append()
d. extend()
Show Answer ⟶Hide Answer ⟵b. list()
38. ________ a single element passed as an argument at the end of the list.
a. append()
b. extend()
c. insert()
d. None of the above
Show Answer ⟶Hide Answer ⟵a. append()
39. Which of the following command is used to add an element in list?
a. new_list.add(5)
b. new_list.added(5)
c. new_list.append(5)
d. All of the above
Show Answer ⟶Hide Answer ⟵c. new_list.append(5)
40. _________ returns the number of times a given element appears in the list.
a. insert()
b. index()
c. count()
d. None of the above
Show Answer ⟶Hide Answer ⟵c. count()
41. A ________ is an ordered sequence of elements of different data types, such as integer, float, string or list.
a. Tuple
b. Dictionaries
c. List
d. None of the above
Show Answer ⟶Hide Answer ⟵a. Tuple
42. Elements of a tuple are enclosed in ________ and are separated by ________.
a. Parenthesis and commas
b. Curly Brackets and commas
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵a. Parenthesis and commas
43. In Tuple, If we assign the value without comma it is treated as ________.
a. Integer
b. String
c. Decimal
d. None of the above
Show Answer ⟶Hide Answer ⟵a. Integer
44. In Tuple, Sequence without parenthesis is treated as _________.
a. Tuple Error
b. Tuple by default
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵b. Tuple by default
45. Elements of a tuple can be accessed in the same way as a list or string using ________.
a. Indexing
b. Slicing
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵c. Both a) and b)
46. Tuple is __________ data types.
a. Immutable
b. Mutable
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵c. Both a) and b)
47. Immutable means __________.
a. Tuple cannot be changed after it has been created
b. Tuple can be changed after it has been created
c. Both a) and b)
d. None of the above
Show Answer ⟶Hide Answer ⟵a. Tuple cannot be changed after it has been created
48. Python allows us to join tuples using __________ operator.
a. Assignment
b. Concatenation
c. Repetition
d. None of the above
Show Answer ⟶Hide Answer ⟵b. Concatenation
49. ________ operator can also be used for extending an existing tuple.
a. Assignment
b. Concatenation
c. Repetition
d. None of the above
Show Answer ⟶Hide Answer ⟵b. Concatenation
51. Concatenation operator depicted by symbol ________.
a. –
b. *
c. +
d. /
Show Answer ⟶Hide Answer ⟵c. +
52. Repetition operation is depicted by the symbol ________.
a. –
b. *
c. +
d. /
Show Answer ⟶Hide Answer ⟵b. *
53. ______ operator help to repeat elements of a tuple.
a. Assignment
b. Concatenation
c. Repetition
d. None of the above
Show Answer ⟶Hide Answer ⟵c. Repetition
54. In python, the repetition operator requires the first operand to be a tuple and the second operand to be _________ only.
a. String
b. Decimal
c. Integer
d. None of the above
Show Answer ⟶Hide Answer ⟵c. Integer
55. The ________ operator checks if the element is present in the tuple.
a. In
b. Not in
c. Out
d. Not Out
Show Answer ⟶Hide Answer ⟵a. In
56. The ________ operator returns True if the element is not present in the tuple, else it returns False.
a. In
b. Not in
c. Out
d. Not Out
Show Answer ⟶Hide Answer ⟵b. Not in
57. _________ returns the length or the number of elements of the tuple.
a. tuple()
b. len()
c. count()
d. index()
Show Answer ⟶Hide Answer ⟵b. len()
58. ________ returns the number of times the given element appears in the tuple
a. tuple()
b. len()
c. count()
d. index()
Show Answer ⟶Hide Answer ⟵c. count()
59. _________ returns the index of the first occurrence of the element in the given tuple.
a. tuple()
b. len()
c. count()
d. index()
Show Answer ⟶Hide Answer ⟵d. index()
60. ________ returns minimum or smallest element of the tuple.
a max()
b. min()
c. sum()
d. None of the above
Show Answer ⟶Hide Answer ⟵b. min()
61. ________ returns maximum or largest element of the tuple.
a max()
b. min()
c. sum()
d. None of the above
Show Answer ⟶Hide Answer ⟵a max()
62. _________ returns sum of the element of the tuple.
a max()
b. min()
c. sum()
d. None of the above
Show Answer ⟶Hide Answer ⟵c. sum()
63. A tuple inside another tuple is called a _______.
a. Tuple Leader
b. Nested Tuple
c. Inner Tuple
d. None of the above
Show Answer ⟶Hide Answer ⟵b. Nested Tuple
64. In python, tuples values are enclosed in _______.
a. Curly brackets
b. Parenthesis
c. Square brackets
d. None of the above
Show Answer ⟶Hide Answer ⟵b. Parenthesis
65. What will be the output of the following code.
str = tuple(“Python”)
print(tuple)
a. [‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’]
b. (‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’)
c. Python
d. None of the above
Show Answer ⟶Hide Answer ⟵b. (‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’)
66. Which of the following is not a function of tuple?
a. sum()
b. max()
c. min()
d. delete()
Show Answer ⟶Hide Answer ⟵d. delete()
67. Which of the following belong to tuple?
a. Elements are enclosed in Parenthesis
b. Tuple is immutable
c. Tuple is a sequence data types
d. All of the above
Show Answer ⟶Hide Answer ⟵d. All of the above
68. Which of the following is the correct syntax to declare tuple?
a. t = 1,2,3
b. t = (‘a’,’b’,’c’)
c. t = (1,2,3)
d. All of the above
Show Answer ⟶Hide Answer ⟵d. All of the above
69. How you can delete tuple with single element?
a. t = 1,
b. t = (1,)
c. Both a) and b)
d. t = [1]Show Answer ⟶Hide Answer ⟵
c. Both a) and b)
70. What will be the output of the following code.
t = (30)
type(t)
a. <class ‘float’>
b. <class ‘string’>
c. <class ‘int’>
d. None of the above
Show Answer ⟶Hide Answer ⟵c. <class ‘int’>
71. What will be the output of the following code.
t1 = (‘Computer’, ‘Science’)
t2 = (85, 65)
print(t1+t2)
a. (‘Computer’, ‘Science’, 85, 65)
b. [‘Computer’, ‘Science’, 85, 65]
c. {‘Computer’, ‘Science’, 85, 65}
d. None of the above
Show Answer ⟶Hide Answer ⟵a. (‘Computer’, ‘Science’, 85, 65)
72. Which of the following operator is used to replicate a tuple?
a. Modular
b. Exponent
c. Addition
d. Multiplication
Show Answer ⟶Hide Answer ⟵d. Multiplication
73. What will be the output of the following code.
t = (‘1’, ‘2’, ‘3’)
print(tuple(“Python”) + t)
a. [‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’, ‘1’, ‘2’, ‘3’]
b. (‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’, ‘1’, ‘2’, ‘3’)
c. {‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’, ‘1’, ‘2’, ‘3’}
d. None of the above
Show Answer ⟶Hide Answer ⟵b. (‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’, ‘1’, ‘2’, ‘3’)
74. Which of the following python function returns the length of tuple?
a. len()
b. length()
c. leng()
d. None of the above
Show Answer ⟶Hide Answer ⟵a. len()
Computer Science Class 12 Notes
- Python Revision tour – 1 Class 12 Notes
- Python Revision tour – 2 Class 12 Notes Notes
- Working with Functions Class 12 Notes
- Using Python Libraries Class 12 Notes
- File Handling Class 12 Notes
- Recursion Class 12 Notes
- Idea of Algorithmic Efficiency Class 12 Notes
- Data Visualization using Pyplot Class 12 Notes
- Data Structure Class 12 Notes
- Computer Network Class 12 Notes
- More on MySQL Class 12 Notes
MCQ for Class 12 Computer Science Python
- Python Revision tour – 1 Class 12 MCQs
- Python Revision tour – 2 Class 12 MCQs
- Working with Functions Class 12 MCQs
- Using Python Libraries Class 12 MCQs
- File Handling Class 12 MCQs
- Recursion Class 12 MCQs
- Data Visualization using Pyplot Class 12 MCQs
- Data Structure Class 12 MCQs
- Computer Network Class 12 MCQs
- More on MySQL Class 12 MCQs
Computer Science Class 12 Questions and Answers
- Python Revision tour – 1 Class 12 Questions and Answers
- Working with Functions Class 12 Questions and Answers
- Using Python Libraries Class 12 Questions and Answers
- File Handling Class 12 Questions and Answers
- Recursion Class 12 Questions and Answers
- Idea of Algorithmic Efficiency Class 12 Questions and Answers
- Data Structure Class 12 Questions and Answers
- More on MySQL Class 12 Questions and Answers
- Computer Network Class 12 Questions and Answers
- More on MySQL Class 12 Questions and Answers