0% found this document useful (0 votes)
2 views

CS sp

Sample paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

CS sp

Sample paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Half Yearly Examination

Grade: XI Session: 2024-25


Computer Science (083)
Set-B
Maximum Marks: 70 Time Allowed: 3 hours

General Instructions:
 This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions
● The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
● Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
● Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
● Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written.
SECTION A
1. ___________ occur due to mistaken analysis of the problem. 1

2. Identify the keywords and identifiers from the following options: 1


a. continue b. while c. age d. Continue
3. Which method is used to find the memory location of variable? 1
id() b. add() c. type() d. class()
4. What will be the output of following code? 1
a,b,c=2,3,4
a,b,c=a*a, a*b, a*c
print(a,b,c)
5. What will be the output of the following statement? 1
print (5%10+10<50 and 29<=29)

6. Following set of commands are executed in shell, what will be the output? 1
>>>str="hello"
>>>str[:2]

7. Which of the following String Literal? 1


a) “ABC”
b) “@123”
c) both a & b
d) None of these
8. for num in range(2, 51): 1
for i in range(2, num):
if num % i == 0:
break
else:
print(num)

9. Identify the output of the following Python statements. 1


b=1
for a in range(1, 10, 2):
b += a + 2
print(b)
a. 31
b. 33
c. 36
d. 39
10. Given is a Python string declaration: 1
message='FirstPreBoardExam@2022-23'
Write the output of:
>>>print(message[ : : -3].upper())

11. What is the size of each string? 1


(i) “MESSAGE@\n123”
(ii) “\table”
12. What will be the output if entered number is 11 1
n=int(input("Enter a number"))
i=2
while i<n:
if n%i==0:
break
print(i)
i=i+1
else:
print("done")
13. _____________ states that the multiplication of two variables and adding the 1
result with a variable will result in the same value as multiplication of addition
of the variable with individual variables.
a.Complement law b. Demorgans law
c. Associative law d. Distributive law
14. Select the correct output of the code : 1
s='[email protected]'
s=s.split('kv')
op = s[0] + "@kv" + s[2]
print(op)
(A) mail2@kvsangathan
(B) mail2@sangathan.
(C) mail2@kvsangathan.
(D) mail2kvsangathan.
15. Abdul got a call from Bank office and asking PIN, OTP and some details for 1
updation of his ATM card. Which of the following is not suggested for Abdul?
(a) He should provide all details as desired by caller.
(b) He should not give any details and contact bank helpline number to check
the validity of the call received.
(c) He should inform local police about the call.
(d) None of the above
16. Select the correct output of the code: 1

Options:
a. PYTHON-IS-Fun
b. PYTHON-is-Fun
c. Python-is-fun
d. PYTHON-Is –Fun
17. Identify the types cyber-attack in each of the following cases: 1
Case I: A software encrypts files and data within a system, making the content
inaccessible until a handsome amount is paid to some third party.
Case II: Hackers render a fully functional website inaccessible to legitimate
customers by illegally blocking the network traffic.
18. Which of the following statement(s) would give an error after executing the following 1
code?
S="Welcome to class XII" # Statement 1
print(S) # Statement 2
S="Thank you" # Statement 3
S[0]= '@' # Statement 4
S=S+"Welcome" # Statement 5
print(s) # Statement 6
What will be the final output?
19.
Write the output of the following code: 1

output = ""
x = -5
while x < 0:
x = x + 1
output = output + str(x) + " "
print(output)

Q20 and 21 are ASSERTION AND REASONING based questions. Mark the
correct choice as
(a)Both A and R are true and R is the correct explanation for A
(b)Both A and R are true and R is not the correct explanation for A
(c)A is True but R is False
(d)A is false but R is True
20. Assertion(A): The for loop is a counting loop that works with sequences of 1
values.
Reason(R): The range() function generates a sequence of list type().
21. Assertion(A): The randint() method returns an integer number selected element 1
from the specified range.
Reason(R): The syntax for randint() is : random.randint(start, stop)
SECTION B
22. Write a program that prints minimum number and maximum number out of the five 2
numbers entered by the user.
23. Prove the following algebraically: 2
X+ Y’Z = (X + Y’ + Z’)(X + Y’ + Z)(X + Y + Z)

OR

XYZ + XYZ’ + XY’Z + X’Y’Z + X’YZ’ = XY + Y’Z + X’YZ’


24. Differentiate between the following with examples: 2
a. Keywords and identifiers
b. Statement and Expression
25. What will be the output produced by following code fragments? 2
x = "hello" + \
"to Python" + \
"world"
for char in x :
y = char
print (y, ' : ', end = ' ')
26. a. Rewrite the following code in python after removing all syntax error(s). 2
Underline each correction done in the code.

30=To
for K in range(0,To)
IF k%4==0:
print (K*4)
Else:
print (K+3)

b. Write a program to execute loop from 10 to 100.


27. “If the IDs of two objects are same then they must have same value, but if any 2
two objects have same value they may not have same ID”. Explain with an
example.
28. Write a program to input a number and check if it is a perfect number or 2
not.

SECTION-C
29. (a) Write the Corresponding Python expression for the mathematical expression: 1
−b ± √ b2−4 ac
x=
2a
(b) Explain the mathematical function with example given below:
i. floor() 2
ii. fabs()
30. a) Correct the code and then print the output.
1. s1=must 1
2. s2=’try’
3. n1=10
4. n2=3
5. print(s1+s2)
6. print(s2*n2)

b) Write a program to input any number and check if it is palindrome or not. 2


The input number must be positive.
31. a) Write a Program to print the following pattern:
A 2
A B
A B C
A B CD
A B CD E 1
b) Write a program to check if the year entered by the user is a leap year or not.
SECTION-D
32. (a) Differentiate the difference between mutable and immutable data types with 1.5
example.
(b) Write the output of the following

1.5

(c) Name the Python Library modules which need to be imported to invoke the
1
following functions:
(1) randrange() (2) mean()
33. (a) Draw the circuit diagram for the Boolean expression 2
F(X,Y,Z)=(X’+Y)(Y’+Z)

(b)What will be the output of the following program.


2

34. a) Suggest appropriate functions for the following tasks: 1.5


1. Write a function to capitalize all the letters of the string S.
2. Write a function check whether all letters of the string S are in capital letters.
3. Write a function to remove all white spaces from the beginning of a string S.

b) Write a program which replaces all vowels in the string with '*'. 1.5
c) What is the output of the following? 1
print("xyyzxyzxzxyy".count('yy',6))
35. a) Write the differences between the following — 2
(a) Copyrights and Patents
(b) Phishing and Hacking
2
(c) General Public License and Apache License
(d) Spyware and Adware

b) Convert the following code into while loop.

SECTION-E
36. (a) Identify the correct output(s) of the following code. Also write the minimum
and the maximum possible values of the variable b.
import random 2
a="Wisdom"
b=random.randint(1,6)
for i in range(0,b,2):
print(a[i],end='#')

(A) W# (B) W#i#


(C) W#s# (D) W#i#s#

(b) Write note on the following:


2
1. Membership Operators 2. Dynamic Typing
3. Exceptions 4. Testing and debugging
(c) Discuss any two suggestions that should be followed to avoid plagiarism 1
while using contents from the Internet.
37. 1. Predict the output of the following code:
import math
print(math.ceil(22.2)) 2
print(math.pow(math.sqrt(4),2))
2. Write a program that takes a string with multiple words and then capitalizes 3
the first letter of each word without using inbuilt function and forms a new
string out of it.

You might also like