Cs SP
Cs SP
SAMPLE PAPER 2
(2019-20)
(F.M:70)
import random
x=random.random()
y=random.randint(0,4)
print(int(x), “:”, y+int(x)) 2
find the suggested output options (i) to (iv). Also, write the maximum and minimum value
that can be assigned to the variable y.
PREPARED BY NAMITA RANJAN, KV AFS BAREILLY pg. 1
(i) 0:0
(ii) 1:6
(iii) 2:4
(iv) 0:3
2
(a) Suppose list1 is [4, 33, 46, 14,25]. What is list1[-1]? 1
(b) What will be the output of the following Python code:-
>>>t=(1,2)
>>>2 * t 1
(i) (1,2,1,2)
(ii) [1,2,1,2]
(iii) (1,1,2,2)
(iv) [1,1,2,2]
(c) What will be the output of the following Python code:-
d={“john”:40, “peter”:45}
print(d[“john”])
(i) 40 1
(ii) 45
(iii) “john”
(iv) “peter”
(d) What is the list comprehension equivalent for: 1
{x:x is a natural number less than 50, x is even}
(e) Find and write the output of the following Python code:-
word=”Hello Python” 1
print(word.find(‘py’,1))
print(word.find(‘o’,5,11))
(f) How are docstrings different from comments? 2
(g) Write code to create a pie for sequence con=[23.4,17.8,25.6,34.2,40] for Zones=[‘East’,
‘West’, ‘North’, ‘South’, ‘Central’]
• Show South Zone’s value exploded
• Show % contribution for each zone.
Or
Give output using a rough drawing(Angles in pie chart may be approximate) of following
code: 2
import matplotlib.pyplot as plt
qdata=[100,200,250,150]
lb=[‘Q1SALE’,’Q2SALE’,’Q3SALE’,’Q4SALE’]
plt.pie(qdata, labels=lb,explode=[0.1,0,0,0.2] )
plt.title(‘Z SQUARE’)
plt.show()
(h) Write code to print just the last line of a text file ‘Story.txt’. Also display the total number
of lines.
OR 2
Write code to write a list content to a file.
(i) Write a recursive function that computes the sum of numbers 1………n
i.e. 1+2+3+….+n where n is an input from user. 3
OR
PREPARED BY NAMITA RANJAN, KV AFS BAREILLY pg. 2
Write a function for Binary Search in a list/array using recursion.
(j) Write a function in Python, PUSHSTUD(Arr) and POPSTUD(Arr) for performing insertion
and deletion operations in a STACK. Accept items from user in a tuple containing
(sid, sname, marks)
OR 4
Write a function in python, QADD(Package) and QDEL(Package) to add a new Package and
delete a Package from a List of Package Price (List of Floats), considering them to act as
insert and remove operations of the Queue data structure.
3
(a) ___________________ is the service that makes our website available to be viewed by 1
others on the Internet.
(b) _____________________ is the domain name of 1
http://www.income.in/home.aboutus.html.
(c) A _______________ establishes connection between two networks and it can handle 1
network with different protocols.
(d) _________________ is a network utility program used to obtain information about 1
internet servers.
(e) Give the full forms of the following:-
(i) GSM
(ii) GPRS 2
(iii) SMTP
(iv) IMAP
(i) Suggest the best wired medium and draw the cable layout to efficiently
connect various wings of Multipurpose Public School, Bengaluru.
(ii) Name the most suitable wing where the servers should be installed. Justify
your answer.
(iii) Suggest a device/software and its placement that would provide data security
for the entire network of the school.
(iv) Suggest a device and a protocol that shall be needed to provide wireless
internet access to all smartphone/laptop users in the campus of Multipurpose
Public School, Bengaluru.
SECTION B
4.
(a) What is NULL value in MySql? 1
(b) What is the purpose of a Foreign Key? 1
(c) What is the use of Group By command? 1
(d) Which keyword eliminates redundant data from a query result? 1
(e) Differentiate between Primary Key and Candidate Key?
Or 2
Differentiate between Char and Varchar data type?
(f) Write the use of GET and POST http requests in Django? 2
(h) Write the output for SQL queries (i) to (iii), and commands for (iv) to (vii) which are based on the
table STUDENT given below:
SECTION C
5
(a) __________________ Certificate establishes legal and valid ownership about an 1
intellectual property.
(b) What are proper methods and steps for the disposal of used electronic items? 1
(c) List the Societal issues induced by technology? 2
(d) Differentiate between the two types of Plagiarism? 2
(e) List the common ways for how one’s identity can be stolen? 2
(f) Write two ways to handle gender issues while teaching/using computers? 2