Section A
1. Which of the following is a valid identifier in Python?
(a) 1value (b) _value (c) @value (d) value#
2. What will be the output of 'Hello'.lower()?
(a) hello (b) Hello (c) HELLO (d) Error
3. Evaluate the expression: 4 + 3 * 2 - 1
(a) 7 (b) 9 (c) 10 (d) 14
4. What is the result of 'Python'[2:5]?
(a) Pyt (b) yth (c) tho (d) ytho
5. Which of the following methods is used to count the number of times an element appears in
atuple?
(a) append() (b) count() (c) index() (d) extend()
6. Which module in Python is used for mathematical calculations?
(a) math (b) string (c) random (d) os
7. What will be the output of {'a': 1, 'b': 2}.get('a')?
(a) 'a' (b) 1 (c) 2 (d) None
8. What will be the result of [1, 2, 3].append(4)?
(a) [1, 2, 3, 4] (b) [4, 1, 2, 3] (c) [1, 2, 3] (d) None
9. Which of the following is a component of the computer system?
(a) Monitor (b) Keyboard (c) Processor (d) All of the above
10. Which type of memory is non-volatile? (a) RAM (b) ROM (c) Cache (d) Register
11. What does ALU stand for?
(a) Arithmetic Logical Unit (b) Array Logic Unit (c) Advanced Logic Unit (d) Arithmetic Line
Unit
12. Which of the following is an example of system software?
(a) Microsoft Word (b) Operating System (c) Web Browser (d) Game
13. Convert binary 1010 to decimal.
(a) 5 (b) 10 (c) 15 (d) 20
14. Convert decimal 26 to hexadecimal.
(a) 1A (b) 2A (c) 26 (d) 3A
15. Which gate represents the output only when both inputs are 1?
(a) OR (b) AND (c) NOT (d) XOR
16. Which logic circuit is used for the Boolean expression A AND B?
(a) OR gate (b) AND gate (c) NOT gate (d) NAND gate
17. What is the Boolean expression for an OR gate?
(a) A + B (b) A - B (c) AB (d) A / B
18. What will be the output of print('Hello' + str(123)) in Python?
(a) Hello123 (b) Hello 123 (c) Error (d) 123Hello
19. In Python, dictionaries are:
(a) Ordered (b) Unordered (c) Indexed (d) Mutable
Section B
22. Explain the difference between mutable and immutable data types in Python, with
examples.
23. Evaluate the following expressions and explain the result:
i) (5 > 3) or (2 > 4) ii) (5 == 5) and (3 < 2)
24. Identify and explain the methods used to perform operations on a list, string, tuple,
and dictionary in Python.
25. Predict the output of the following code and explain the purpose of the random
module:
import random
print(random.choice([10, 20, 30, 40]))
26. Find and explain any errors in the following code. Rewrite the code to correct the
errors:
python (for i in range(5)
print(i)
27. What will be the output of the following code? Explain the result.
python a = 15 b = 25
print(a * b)
28. Write a Python code snippet using string functions with conditional statements and
looping to check if each word in a list starts with a vowel
Section-C
29. (a) Write a Python program to print any of the following patterns using loops:
*
**
***
****
(b) Write a Python program using a conditional statement and looping to display all even
numbers from 1 to 20.
30 (a) Write a program in Python using the if-else statement to check if a number
is positive, negative, or zero
(b) Write a program in Python using the if-elif-else statement to determine the grade
based on the following marks criteria:
Marks >= 90: Grade A
Marks >= 75 and < 90: Grade B
Marks >= 60 and < 75: Grade C
Marks < 60: Grade D
31. (a) Convert the following numbers into binary, octal, and hexadecimal formats:
i)Decimal 45 ii) Decimal 29
(b) Draw a logic circuit for the Boolean expression .
(c) Given the following Boolean expression, simplify and draw the corresponding logic
circuit:
Section-D
32. Given a dictionary student = {'name': 'John', 'age': 17, 'grade': 'A'}, write a Python
program to:
a) Add a new key-value pair {'subject': 'Math'} to the dictionary.
b) Update the 'grade' to 'A+'.
c) Delete the 'age' key from the dictionary.
d) Print the final dictionary.
33. Write a Python program using list operations to:
a) Create a list with elements [10, 20, 30, 40, 50].
b) Append 60 to the list.
c) Remove 20 from the list.
d) Print the modified list and its length.
34.a) i)s=(10, 20, 30, 40, 50)
print(70 in s)
ii) s=(10, 20, 30, 40, 50)
print(50 in s)
b) s=(10, 20, 30, 40, 50)
s.append(100)
print(s)
35.a) Write a program to input the value of x and n print the sum of the
series:1+x+x2+x3+x4…….
b)write a program to accept a number for the user and display whether it is an
Armstrong number or not
or
write a program to accept a word for the user and display whether it is an pallindrome
or not
Section-E
36. 1. Evaluate any two of the following number conversions:
i)(123)10=()2 ii)(56)10=()8
2. Prove any one of De Morgan's laws using a truth table.
3. Differentiate between any two built-in data structures in Python: String, List
4. Draw a flowchart for a simple logic of your choice (e.g., calculating the sum of first `n`
natural numbers)