SQP Xi
SQP Xi
TERM-1
Computer Science
TIME: 03 HOURS M.M.: 70
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each.
SECTION A
1. What will be the output of following python code? 1
a,b=3,4
a, b, c=b ,a+3 ,b-1
print (a,b,c)
2. Evaluate the following expression and give the final result that would be stored in X: 1
X = 2 * 3 / 5 + 10 // 3 -1
3. What would be the correction for following code:- 1
Num=input(“Enter Number”)
num=Num*2
print(num)
4. Which of the following is the fastest memory? 1
a. Primary Memory b. Cache Memory c. Secondary Memory d. None of these
5. ______ acts as an interface between the operating system and the attached device. 1
a. Programming Tools b. System Utility c. Device Driver d. None of these
6. Choose the correct option: 1
1st _number=23
Statement 1: Above statement is correct.
Statement 2: An identifier cannot have any special characters other than
the underscore (_), digits, uppercase, or lowercase characters.
a. Only statement 1 is true.
b. Only statement 2 is true.
c. Both statements 1 and 2 are true, but statement 2 is not correct reasoning of statement
1.
d. Both statements 1 and 2 are true, but statement 2 is correct reasoning of statement
7. Which of the following is not a valid identifier name in Python? Justify reason for it 1
not being a valid name.
a) 5Total b) _Radius c) pie d)While
8. Write the full form of RAM & ROM. 1
9. How many times the following loop will run? 1
for i in [1,2,3]:
a. 0 b. 1 c. 2 d. 3
10. Consider the following Python code snippet: 1
number = 7
while number > 0:
print(number)
number - = 3
What will be the output of the code and how many times will the print(number) statement be
executed?
a. The print(number) statement will be executed 3 times and the output will be 7 4 1.
b. The print(number) statement will be executed 4 times and the output will be 7 4 1 -2.
c. The print(number) statement will be executed 2 times and the output will be 7 4.
d. The print(number) statement will be executed 1 time and the output will be 1.
11. Which of the following is not considered an advantage of using Python? 1
a. Easy to Learn and Read: Python’s syntax is simple and resembles natural language,
making it easy for beginners to learn and understand.
b. High Performance: Python is known for its high performance in execution speed
compared to compiled languages like C++.
c. Large Standard Library: Python has a vast standard library that supports many
programming tasks and provides extensive modules and packages.
d. Cross-Platform Compatibility: Python is cross-platform and can run on various operating
systems like Windows, macOS, and Linux.
12. Which of the following statements accurately describes the differences between 1
interactive mode and script mode in Python?
a. Interactive mode allows you to execute Python code line by line and see immediate
results, whereas script mode involves running an entire script file which contains multiple
lines of code.
b. Interactive mode is used to run Python scripts saved on disk, while script mode allows
you to execute code line by line directly from the terminal.
c. Interactive mode is best suited for writing and saving long programs, while script mode
is used for immediate code execution and testing.
d. Interactive mode can only be used for executing code in .py files, while script mode allows
you to execute code in any file format.
13. What will be the output of the following Python code? 1
for i in range(1, 4):
print(i * i)
a. 1 4 9 b. 1 2 3 c. 1 4 6 d. 1 3 5
14. Which of the following pieces of code will create an infinite loop? 1
a. b. c.
SECTION B
19 Differentiate between primary memory and secondary memory with examples. 2
OR
What is an operating system and why is it important?
20. The python code written below has syntactical errors. Rewrite the correct code and 2
underline the corrections made.
a = input(“Enter value of “)
b = 20
if a < b
print(‘a is less than b")
else
print("a is not less than b"
21. Explain the difference between an interpreter and a compiler in Python programming. How 2
does each handle code execution, and what are the implications for debugging and
execution speed?
22. Convert the following: 2
a)(363)8 to Binary
b)(00101101)2 to Hexadecimal
23. What are the functions performed by the control unit? 2
24. WAP to accept 10 numbers from user and display their average. 2
25. WAP to display first 30 natural numbers in reverse order using while loop. 2
SECTION C
26. Write down the type of memory needed to do the following: 3
i) To execute the program
ii) To store the instructions which cannot be overwritten
iii) To store frequently accessed data for quick retrieval and improve performance in an
application:
27. a) Explain the difference between interactive mode and script mode in Python 3
programming.
b) Write a short Python script that demonstrates the use of both modes. In the
interactive mode, show how to declare a variable and print its value. In the script mode,
write a Python script to declare a variable and print its value to a file. Provide a brief
description of how you would run this script.
28. Draw flow chart to find the sum of first 50 even numbers. 3
F=AB|+(A+B)+CB|
32. Write a Python program that prompts the user to enter the marks obtained in 5 subjects out 4
of 100 each. The program should then calculate and display the following:
1. The total marks obtained.
2. The average marks obtained.
3. The percentage marks.
4. The grade based on the percentage as follows:
o A+: 90% and above
o A: 80% - 89%
o B: 70% - 79%
o C: 60% - 69%
o D: 50% - 59%
o F: Below 50%
SECTION E
33. Prove the distributive law using the truth table. 5
34. Explain the steps in problem solving cycle with diagram 5
35. A company's IT department is facing issues with their computer systems. The computers are 5
experiencing frequent crashes, and some peripheral devices like printers and scanners are
not functioning properly. As a computer science student, identify and explain the role of two
types of system software that could be contributing to these issues. Suggest possible
solutions that the IT department could implement to resolve these problems.