cbse class 12 computer science python question paper with solutions

 cbse class 12 computer science python question paper with solutions

download quesion paper pdf

download answer paper pdf

                  Practice test paper  1

                   Computer Science

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

                               SECTION-A

Q 1.

(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:
         print(“freezing”)
(ii) L=[‘hiya’,’zoya’,’preet’]
      n=len(L)
      if ‘donald’ in l[1:n]:
           print(L)
(c) which python libraries/modules need to be imported to use folloowing functions ?   (1)
      (i)log()                    (ii)barh()
(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.
               if v<5:
                   for j in range(v):
                         print “ABC”
               else:
                     print “XYZ”
(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)
              def  func(alist):
                      alist=[1,2,3,4]
                        print(alist)
                        return
              mylist=[10,20,30]
              func(mylist)
              print(mylist)
(g)consider the following code:              (2)
          imort math
          import random
          print(str(int(math.pow(random.randint(2,4),2))),end=’  ‘)
          print(str(int(math.pow(random.randint(2,4),2))),end=’  ‘)
          print(str(int(math.pow(random.randint(2,4),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

Q 2.

(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)
      LA=[1,2,9,16,25,36,49,64,81,100]
      LB=[num/3 for num in LA if num%3==0]
      print(LB)
(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
         zones=[‘east’,’west’,’north’,’south’,’central’]                (2)
            cbse class 12 computer science python question paper with solutions
      – show north zone’s value exploded
     –  show % contribution for each zone
     – the pie chart should be circular.
                                        or
  what is the worst case complexity of the following code fragment?
1.   for i in range(n):
2.          a=i+(i+1)
3.          print(a)
4.  for j in range(m):
5.         b=i*(i+1)
6.         print(b)
(h) write a function stats( ) that accepts a filename and reports the file’s longest line.   (2)
                                                    or
     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)
                                               or
  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)
                                           or
     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)

                             SECTION-B

cbse class 12 computer science python question paper with solutions

Q 3.

(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
called________.      (1)
(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
      network?     (2)
(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
             RFID,internet etc.
(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)
cbse class 12 computer science python question paper with solutions
(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

                          SECTION-C

Q 4.

(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)
      (i)DML                                        (b)DDL
      (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)
                                        or
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)
cbse class 12 computer science python question paper with solutions
       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)
cbse class 12 computer science python question paper with solutions
cbse class 12 computer science python question paper with solutions
(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

                        SECTION-D

Q 5.

(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
        transmission?         (2)
(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)