Solutions Sample Paper CS11 Paper 2023-2024
Solutions Sample Paper CS11 Paper 2023-2024
Ans b. 34.0
Ans d. Real
Ans a. [2,5,1,7,2,5,1,7]
a. None
b. 1
c. False
d. True
Ans d. True
#1/10
d. median()
Ans c. floor()
Ans a. Logical
8 Which of the following outputs is the correct option for the code shown here ? 1
STR='TEXT CONTENT'
print(STR.strip('T'))
a. EX CONEN
b. EX CONTEN
c. EXT CONTEN
d. TEXT CONTEN
Ans d. Eavesdropping
Ans a. not
Ans c. D1=D.copy()
#2/10
12 Which of the following operators displays the remainder with integers ? 1
a. **
b. %
c. //
d. +
Ans b. %
Ans b. Windows
Ans c. print(sorted(Grade))
a. 25
b. 26
c. 27
d. 26.5
Ans b. 26
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
choice as
a. A is True and R is the correct explanation for A
b. A is True but R is not the correct explanation for A
c. A is True but R is False
#3/10
d. A is False but R is True
Reason (R): The split() method returns a list of words separated at the
parameter sent.
SECTION B
19 Rewrite the following logic using a while loop without making any change in the 2
expected output:
L=[3]
for I in range(5):
L.append((I+1)*5)
print(L)
Ans L=[3]
I=0
while I<5:
L.append((I+1)*5)
I=I+1
print(L)
#4/10
Ans Copyright is a type of intellectual property that protects original works of
authorship as soon as an author fixes the work in a tangible form of expression.
Under copyright law, there are a lot of different types of works- paintings,
photographs, illustrations, musical compositions, sound recordings, computer
programs, books, poems, blog posts, movies, architectural works, plays etc.
Ans a. 84
b. 78
Ans MON#TUE#WED#THU#FRI
OR
#5/10
OR
Draw a logic circuit equivalent for the following Boolean Expression:
(A’.B’)+ C’
Ans
OR
SECTION C
26 What is Data Protection? Give any two ways to protect your data online. 3
OR
Define the following terms :
a) Ransomware
b) Cyber Crime
Ans Data protection is the process of protecting sensitive information from damage,
loss, or corruption.
OR
a) Ransomware is a form of malicious code or malware that hackers use to
lock or encrypt data and make the entire/partial data inaccessible on an
#6/10
individual computer or web-server or entire network to extort money.
b) Cybercrime is a crime that involves a computer and a network. The
computer may have been used in the commission of a crime, or it may be
the target. Cybercrime may harm someone's security, social and financial
health.
27 Give any three basic rules of netiquette to avoid damaging your online as well as 3
offline relationships.
Ans split() It returns a list of substrings after breaking the given string with a
given separator.
<List>=<Str>.split(<Separator>[,<Maxsplit>])
Separator : String splits at this specified <Separator>. space is the default
separator.
Maxsplit : A number, to split the string into maximum of provided number of
times. If not provided then there is no limit.
Example:
print("BELIEVE IN SELF".split('L'))
Output:
['BE', 'IEVE IN SE', 'F']
partition() To search for a specified string, and split the main string into a
tuple containing three elements.
<Tuple>=<Str>.partition(<Partition String>)
Partition String : A string that will partition the Str into three parts in a tuple.
Example:
print("BELIEVE IN SELF".partition('IN '))
Output:
('BELIEVE ', 'IN ', 'SELF')
29 Write a Python code to accept a number and display its factors. The process 3
should continue till the user wants.
For Example
Enter N: 10
Factors: 1,2,5,10
#7/10
print(I,end=",")
print()
C=input("More ? (Y/N) ")
if C.upper()=="N" :
break
SECTION D
Ans NUM=[]
for i in range(10) :
Num[i]=int(input("Enter integer: "))
print("Multiples of 5 are: ")
for i in NUM:
if i%5==0 :
print(i,end = ",")
#8/10
print()
print("Highest integer = ", max(NUM), "Lowest integer = ",
min(NUM))
print("Sorted order : ", sorted(NUM))
Ans SUB=()
MARKS=[]
for i in range(5):
S=input("Subject: ")
SUB += (S,)
M=int(input("Marks "))
MARKS.append(M)
RECORD={}
for i in range(5):
RECORD[SUB[i]]=MARKS[i]
print(RECORD)
33 Convert the following from one number system to another ( show the complete 5
working ) :
a. (512)10 = ( )2
b. (10010111)2 = ( )10
c. (451)8 = ( )16
d. (111001101)2 = ( )8
e. (175)10 = ( )8
As a. (1000000000)2
b. (151)10
c. (129)16
d. (715)8
e. (257)8
SECTION E
34 Write single line Python commands to perform each of the following operations: 4
QUOTE="Life is beautiful"
● Display the length of the string QUOTE.
● Display the reverse of the string QUOTE.
● Display the count of 'i' from the string QUOTE
● Display the substring 'beauti' from the string QUOTE.
#9/10
35 Write a python code to accept values of X as float and N as int, find and display 4
the sum of following series:
(a) 1 + 4 + 7 + ... upto N
(b) 1/X1 + 1/X2+ 1/X3... upto Nth Terms
Ans (a)
N=int(input("Enter N: "))
S=0
for i in range(N):
S+=(3*i+1)
print(S)
(b)
N=int(input("Enter N: "))
X=float(input("Enter X: "))
S=0;F=1
for i in range(N):
F*=i
S+=1/F
print(S)
#10/10