Practice test paper 1
time: three hours max marks: 70
All questions are compulsory. Question paper is divided into 4 sections, A,B,C and D
Section A : unit 1, Section B : unit 2, Section c : unit 3, Section D : unit 4
(a) which of the following is not a keyword? (1)
(a)eval (b)assert (c)nonlocal (d) pass
(b)below are some segments of code,each with a part coloured. indicate the data type of each coloured part by choosing the correct type of data from the following type. (1)
(a)int (b)float (c)bool (d)str (e)function (f)list of int (g)list of str
(i) if temp<32:
if ‘donald’ in l[1:n]:
(c) which python libraries/modules need to be imported to use folloowing functions ? (1)
(d)find the errors in the following code and write correct code. (2)
(i)underline the corrections
(ii)write the reason/error next to it comment form.
for j in range(v):
(e)consider the following code and determine how many times statement 1 and 2 (marked) will get ececuted? (2)
for a in range(0,7,4):
print(a) #statement 1
for b in range(0,a+2,2)
print(b) #statement 2
(f)determine the output of the following: (3)
(g)consider the following code: (2)
what could be possible outputs out of the given four choices?
(i) 2 3 4 (ii) 9 4 4 (iii) 16 16 16
(iv) 2 4 9 (v) 4 9 4 (vi) 4 4 4
(a) though tuples are immutable type, yet they cannot always be used as keys in a dictionary ? (1)
(b) if a is (1,2,3) what is the difference (if any) between a*3 and (a,a,a) ? (1)
(c) what is the difference between r+ and w+ modes? (1)
(i) no difference.
(ii) in r+ mode,the pointer is initally placed at the begining of the file and for w+, the
pointer is place at the end.
(iii) in w+ mode,the pointer is initally placed at the begining of the file and for r+, the
pointer is place at the end.
(iv) depends on the operating system.
(d) what would be the data type of variable data in following statements? (1)
(a) data = f.readline( ) (b) data = f.readlines( )
(e) pridict the output. (1)
LB=[num/3 for num in LA if num%3==0]
(f) what is a module,package and a library? (2)
(g)write to create a pie for sequence con=[23.4,17.8,25,34,40] for
– show north zone’s value exploded
– show % contribution for each zone
– the pie chart should be circular.
what is the worst case complexity of the following code fragment?
1. for i in range(n):
4. for j in range(m):
(h) write a function stats( ) that accepts a filename and reports the file’s longest line. (2)
write a function remove_lowercase( ) that accepts two filenames,and copies all lines
that fo not start with lowercase letter from the first file into the second.
(i) write recursive code to compute and print sum of squares of n numbers. value of n is
passed as parameter? (3)
write recursive code to compute greatest common divisor of a two numbers?
(j) write a program that depending on user’s choice, either pushes or pops an element in
a stack. (4)
A line of text is read from the input terminal into a stack. write a program to output
the string in the reverse order, each character appearing twice.
(e.g., the string a b c d e should be changed to ee dd cc bb aa)
cbse class 12 computer science python question paper with solutions
(A) network in which every computer is capable of playing the role of a client, or a server or both at same time is called (1)
(a) peer – to- peer network (b) local area network
(c) dedicated server network (d) wide area network
(B) a computer network that spans a relatively large geographical area is
(C) traditionally,LANs are said to have geographical spread of upto 1 km (true/ false) (1)
(D)which of the following is the fastest media of data transfer? (1)
(a) co-axial cable (b) untwisted wire
(c) telephone lines (d) fibre optic
(E) write full forms for (i) FTP (ii) HTTP (iii)HTML (iv) PAN (2)
(F) what are the basic methods of checking errors in the data being transmitted over
(G) identify the term/protocol/device from the given description. (3)
(i)a unique physical address given to each NIC card.
(ii)a table maintained by routes to determine best routes to other network at specific
instance of time?
(iii)a network of “things”, smart enabled devices connected through sensor
(H) workalot consultants are setting up a secured network for their office campus at gurgaon for their day-to-day office and web-based activities.they are planning to have connectivity between 3 buildings and the head office situated in mumbai. answer the questions (i) and (iv) after going through the building positions in the campus and other detail, which are given below: (4)
(i)suggest the most suitable place(i.e., building) to house the server of this organization.also give a reason to justify your suggested location.
(ii)suggest a connection medium to connect ganga office with headoffice.
(iii)suggest the placement of the following devices with justification:
(a) switch (b) repeater
(iv)the organization is planning to provide a high speed link with its head office situated in mumbai using a wired connection. which of the following cables will be most suitable for this job?
(a)optical fibre (b)co-axial cable (c)ethernet cable
(a) A_______is a property of the entire relation,which ensures through its value that each tuple is unique in a relation. (1)
(i) Rows (ii)Key (iii)Attribute (iv) Fields
(b) consider following SQL statement.what type of statement this? (1)
create table employee(name VARCHAR,id INTEGER)
(iii)DCL (d)integrity constraint
(c) consider following SQL statement.what type of statement is this? (1)
insert into instructor values(10211,’shreya’,’biology’,66000);
(i)procedure (ii)DML (iii)DCL (iv)DDL
(d) in the given query which keyword has to be inserted? (1)
insert into employee______(1002,kausar,2000);
(i)table (ii)values (iii)relation (iv)field
(e) what is the different between WHERE and HAVING clause? (2)
differentiate between Candidate key and Alternate key in the context of RDBMS?
(f) (i) what is web framework?
(ii) write Django command to create a Django project namely easysell? (2)
(g) consider the following tables CARDEN and CUSTOMER and answer the following parts of this question: (3)
give the output of the following SQL queries:
(i) select count (distinct make) from carden;
(ii) select max(charges),min(charges) from carden;
(iii) select count(*),make from carden;
(h) consider the following tables ITEM and CUSTOMER. write SQL commands for the following statements. (4)
(i) to display the details of those customer whose city is delhi
(ii) to display the details of item whose price is in the range of 35000 to 55000(both values included)
(iii) to display the customerName, city from table customer, and itemName and price from table item, with their corresponding matching I_ID
(iv) to increase the price of all items by 1000 in the table Item
(a) when someone steals someone else’s personal information to commit theft or fraud,it’s called______. (1)
(i)identity theft (ii)hacking
(iii)computer privacy (iv)infringement
(b) which of the following is not a type of cybercrime? (1)
(i)data theft (ii)forgery
(iii)damage to data and systems (iv)installing antivirus for protection
(c) what measures can you take to crub online frauds? (2)
(d) what is secure data transmission ?what technical ways are used to ensure the secure
(e)why should E-waste be handled properly? is it toxic? (2)
(f) list gender related issues in teaching and using computers. (2)
(cbse class 12 computer science python question paper with solutions)