Class 12 Computer Science – Worksheet
Chapter 1: Review of Python (Class XI Concepts)
Total Questions: 80
Section A: Multiple Choice Questions (1–10)
1. Which of the following is an invalid identifier in Python?
a) _myvar b) 2nd_var c) Var_2 d) None
2. What is the output of print(type(5/2))?
a) <class 'int'> b) <class 'float'> c) <class 'complex'> d) Error
3. Which operator is used for Floor Division?
a) / b) // c) % d) **
4. What will be the output of print('Python' * 2)?
a) PythonPython b) Python 2 c) Error d) Python**2
5. Which of the following is a mutable data type?
a) String b) Tuple c) List d) Dictionary e) Both c and d
6. Identify the valid declaration of a dictionary:
a) d = {1,2,3} b) d = (1:'A',2:'B') c) d = {1:'A',2:'B'} d) d=[1:'A']
7. What is the result of bool(0)?
a) True b) False c) 0 d) None
8. Which function is used to get the length of a list?
a) length() b) count() c) len() d) size()
9. What is the index of the first element in a Python list?
a) 1 b) -1 c) 0 d) Any number
10. Which keyword is used to start a function in Python?
a) func b) define c) def d) function
Section B: Short Answer (11–25)
11. Difference between Interactive mode and Script mode.
12. Explain Mutable and Immutable data types with examples.
13. What are Tokens in Python? Name the types.
14. Difference between /, // and % operators.
15. Explain the range() function with syntax.
16. Difference between append() and extend() methods.
17. Define Type Casting (Explicit and Implicit).
18. What is a Nested Loop? Give an example.
19. Purpose of break and continue statements.
20. What is a Docstring?
21. Features of Python.
22. Difference between tuple and list.
23. Explain logical operators and, or, not.
24. Importance of indentation in Python.
25. Explain membership operators in and not in.
Section C: Output Based Questions (26–30)
26. Predict output:
x=10; y=20; x,y=y,x+2; print(x,y)
27. L=[10,20,30,40]; print(L[1:3])
28. s='Computer Science'; print(s[-7:])
29. d={'Rno':1,'Name':'Amit'}; print([Link]('Age',15))
30. for i in range(1,10,3): print(i,end=' ')
Section D: Error Finding (31–33)
31. val=input('Enter a number'); if val = 10: print('Success')
32. for i in range(5) print(i)
33. T=(10,20,30); T[1]=40; print(T)
Section E: Programming Questions (34–50)
34. Program to find largest of three numbers.
35. Program to check prime number.
36. Program to print Fibonacci series.
37. Program to find factorial using loop.
38. Create list of names and search user input.
39. Program to count vowels in string.
40. Dictionary storing states and capitals.
41. Reverse a string without built-in function.
42. Explain slicing with example.
43. Difference between is and ==.
44. Removing element from list using pop(), remove(), del.
45. Program to find sum of list elements.
46. Output of print(list(range(5,0,-1))).
47. Create empty tuple and dictionary.
48. Swap two numbers without third variable.
49. Explain bitwise operators.
50. Explain escape sequences.
Section F: Additional MCQs (51–60)
51. Output of print(5>3 and 2<1).
52. Output of print(10%3).
53. Create empty list syntax.
54. Operator that checks identity of objects.
55. Output of print(bool('')).
56. Output of len([1,2,[3,4]]).
57. Which is not Python keyword?
58. Function converting number to string.
59. Output of print('A'>'a').
60. Method to insert element at specific position in list.
Section G: Assertion Reason (61–63)
61. Lists are mutable. Reason: elements can change.
62. Strings are immutable.
63. Tuples are faster than lists.
Section H: Output Programs (64–68)
64. for i in range(3): print(i*2)
65. L=[5,10,15]; [Link](20); print(L)
66. S='Python'; print(S[1:4])
67. x=5; y=2; print(x**y)
68. print(list(range(2,10,2)))
Section I: Application Based (69–80)
69. Program to print even numbers 1–50.
70. Program to find sum of digits.
71. Program to check palindrome number.
72. Program to find largest element in list.
73. Program to count words in sentence.
74. Program to print multiplication tables 1–5.
75. Program to print odd numbers from list.
76. Program to sort list in ascending order.
77. Case study: marks list – find highest, lowest, average.
78. Case study: dictionary student – access, add, delete.
79. Program to check vowel or consonant.
80. Program to count frequency of character.