0% found this document useful (0 votes)
565 views10 pages

Solutions Sample Paper CS11 Paper 2023-2024

Uploaded by

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

Solutions Sample Paper CS11 Paper 2023-2024

Uploaded by

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

Sample Paper - Final Exam (Theory) - 2023-2024

Computer Science (083)


Maximum Marks: 70 Time Allowed: 3 hours
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 18 questions carrying 1 mark each.
4. Section B has 07 Very Short Answer type questions carrying 2 marks each.
5. Section C has 05 Short Answer type questions carrying 3 marks each.
6. Section D has 03 Long Answer type questions carrying 5 marks each.
7. Section E has 02 questions carrying 4 marks each.
8. All programming questions are to be answered using Python Language only.
SECTION A

1 Evaluate the following expression in Python: 1


print( 17//2 * 3 + 10.0)
a. 34.5 b. 34.0 c. 25.0 d. 34

Ans b. 34.0

2 Which of the following is an invalid datatype in Python? 1


a. tuple b. dict c. int d. Real

Ans d. Real

3 What will be the output of the following code: 1


NumLst = [2,5,1,7]
print(NumLst * 2)
a. [2,5,1,7,2,5,1,7]
b. [2,5,1,7][2,5,17]
c. [4,10,2,14]
d. Error

Ans a. [2,5,1,7,2,5,1,7]

4 Consider the given expression: 1


False or not False and True
Which of the following will be the correct output if the given expression is
evaluated?

a. None
b. 1
c. False
d. True

Ans d. True

5 Which of the following is a function of the math Module? 1


a. random()
b. mean()
c. floor()

#1/10
d. median()

Ans c. floor()

6 ________________ is a software with source code that anyone can inspect, 1


modify, and enhance.
a. Operating system
b. Utility software
c. Compiler
d. Open Source

Ans d. Open Source

7 The operator ‘and’ is a ____________operator in Python ? 1


a. Logical
b. Relational
c. Arithmetic
d. Augmented

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 c. EXT CONTEN

9 ________________is a cyber attack, also known as sniffing. 1


a. Virus
b. Phishing
c. Spam
d. Eavesdropping

Ans d. Eavesdropping

10 Which of the following is a Logic Gate? 1


a. not
b. in
c. between
d. like

Ans a. not

11 Which of the following is the correct way to make a copy of a dictionary D ? 1


a. D=D1
b. D1+=D
c. D1=D.copy()
d. D1=D.assign()

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. %

13 Which of the following is an example of system software ? 1


a. Open office
b. Windows
c. Antivirus
d. Firefox

Ans b. Windows

14 Consider the following statement: 1


Grade={10:'A', 30:'C', 20:'B'}
Which of the following is the correct option to display the sorted list of the keys
in the dictionary Grade in ascending order ?
a. print(sort(Grade.keys()))
b. print(Grade.sort())
c. print(sorted(Grade))
d. print(sort(Grade))

Ans c. print(sorted(Grade))

15 ________________are visitors who leave inflammatory comments in public 1


comment sections.
a. Cyber Trolls
b. Hackers
c. Digital footprints
d. Confidentiality

Ans a. Cyber Trolls

16 What will be the output of the given code? 1


import math
math.floor(26.5)

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

17 Assertion(A): The Python statement "SPLITTED STRINGS".split("S") will 1


return ['PLITTED ', 'TRING']

Reason (R): The split() method returns a list of words separated at the
parameter sent.

Ans d. A is False but R is True

18 Assertion (A):- The expression sorted('TEXT') in Python will give Error. 1

Reasoning (R):- String is an immutable type in Python.

Ans d. A is False but R is True

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)

20 The following code is expected to display whether an integer entered by user is 2


Prime or not. Rewrite the following code after removing all the errors with each
of the corrections underlined:

n=int(input("Enter number to check :: ")


for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else
print("Number is prime \n’)

Ans n=int(input("Enter number to check :: ") )


for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else :
print("Number is prime \n ")

21 Differentiate between copyrights and trademarks. 2

#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.

A trademark (trade-mark) is a type of intellectual property consisting of a


recognisable logo, sign, design, or expression which identifies products or services
of a particular source from those of others. The trademark owner can be an
individual, an organization, or a legal entity

22 Write the output of the Python code given below: 2


L=[123,155,"b",128,160,"A"]
for R in range(1,len(L)):
if not(str(L[R]).isalpha()) and L[R]%10==12:
L[R]= L[R+1]
elif str(L[R]).isalpha():
L[R]=ord(L[R])+2
else:
print(L[R],end=" ")
print()
print(L)

Ans 155 128 160


[123, 155, 100, 128, 160, 67]

23 Write the results of the following: 2


a. print(6 * 15 - 2 // 7 - 2 * 3)
b. print(12 * 3 + 43 - 2 + 5 % 2)

Ans a. 84
b. 78

24 Write the output of the Python code given below: 2


D=('SUN','MON','TUE','WED','THU','FRI','SAT')
L=D[1:len(D)-1]
print('#'.join(L))
OR
Write the output of the Python code given below:
D={'Grapes':50,'Mango':70,'Banana':20}
print(sorted(D))

Ans MON#TUE#WED#THU#FRI

OR

['Banana', 'Grapes', 'Mango']

25 Draw a logic circuit equivalent for the following Boolean Expression: 2


A’ + B’ + C’

#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.

● Keep the Web Browser up-to-date with latest updates/versions


● Always access information from reliable and secured websites (https:)
● Do not install non-reliable extensions on the browser
● Do not keep passwords and login details saved on the browser, logout from
all accounts as soon as you complete your work
● Do not get tempted by the unrealistic offers shown in pop-ups
● Do not reveal your OTP/Personal information on any random site
● Do not download anything from website without verifying the authenticity
of the website
● While working on public computers, always login using Incognito
Window/Private Window/InPrivate Window of the browser

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 ● Share With Discretion


● Always Use Respectful Language
● Make Real People a Priority
● Don't Exclude Others
● Choose Friends Wisely
● Don't Email Large Files

28 Differentiate between split() and partition() in Python. Give suitable examples of 3


each.

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

Ans while True:


N=int(input("Enter N :"))
print("Factors : ",end="")
for I in range(1,N+1):
if N%I==0 :

#7/10
print(I,end=",")
print()
C=input("More ? (Y/N) ")
if C.upper()=="N" :
break

30 Write a python program to create a dictionary STUDENT containing StudentNames 3


as keys and corresponding Marks as values. The program should create a list
STUD, of those StudentNames for which Marks is less than 33.
OR
Write a Python code to accept a string from the user , find and display the counts
of special characters, alphabets and digits present in it.

Ans STUDENT={"AMIT":90, "AJAY":30, "ANIK":80, "ANIL":25}


STUD=[]
for K,V in STUDENT.items():
if V<33 :
STUD.append(K)
OR
S=input("ENTER STRING : ")
S=A=D=0
for C in S :
if C.isalpha() :
A+=1
elif C.isdigit() :
D+=1
else:
S+=1
print("Special Characters = ",S)
print("Alphabets = ",A)
print("Digits = ",D)

SECTION D

31 Write a Python code to 5


● Input 10 integers into a list NUM.
● Display all the multiple of 5 from the list NUM
● Display the highest and lowest integer from the the list NUM
● Display the list NUM in the ascending order.

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))

32 Write a Python code to 5


● Input Name of 5 subjects in the tuple SUB
● Input the Marks of these 5 subject in a list MARKS
● Create a dictionary RECORD and store the SUB as KEY with MARKS as VALUE
in the dictionary RECORD.
● Display the Dictionary RECORD.

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.

Ans QUOTE="Life is beautiful"


print(len(QUOTE))
print(QUOTE[::-1])
print(QUOTE.count("i"))
print(QUOTE[8:14])

#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

You might also like