Class 12 : Python Sample Paper 1

By Rajesh Shukla

Sample Paper 1       Solution Sample Paper 1
Sample Paper 2       Solution Sample Paper 2

Class XII

Sample Paper : 1

Subject : Python

Max. Marks: 70                                                           Time : 3 hrs      

General Instructions:

  • All questions are compulsory.
  • Question paper is divided into 4 sections A, B, C and D.
  • Section A : Unit-1 [30 marks (Q1,Q2,Q3)]
  • Section B : Unit-2 [15 marks(Q4)]
  • Section C: Unit-3 [15 marks(Q5)]
  • Section D: Unit-4 [10 marks(Q6)]

Section A

Q.1.
a. Which of the following is not a valid arithmetic operator in Python : [1]
(i) // (ii) % (iii) + (iv) and

b. What is the difference between keyword and identifiers in python? [2]

c. Name the python library module which needs to be imported to invoke the following functions? [2]
(i). floor() (ii). sin()

d. Observe the following python code very carefully and rewrite it after removing all the syntactical errors with each correction underlined. [3]

#function definition
def SUM(n1,n2):
    s=n1+n2
    print("Sum = "s)
#function calling
a=int(input("Enter 1st no "))
b=int(input("Enter 2nd no "))
sum(a,b,c)

e. Find the output of the following program if “HeLL123o” is given as input? [2]

#function definition
def show(n):
    for i in n:
        print(i.lower(),end='')
#function calling
a=input("Enter any string ")
show(a)

Q.2.

a. Write the definition of a function show(x) in python to display cube of the elements of the list x in the following manner? [3]
Example : if list x contains 5 elements

X[0]

X[1]

X[2]

X[3]

X[4]

3

2

5

4

10

After executing the function the output should be:
3:27
2:8
5:125
4:64
10:1000

b. Identify the valid declaration of L: [1]
L = (1, 23, ‘hi’, 6)
(i) list (ii) dictionary (iii) array (iv) tuple

c. What is stacks ? give its applications? [3]

d. Write a python program to implement a stack for book details (bcode, btitle, price). Write push and pop operations using a list? [3]

Q.3.

a. What is a Queue? Give its applications? [3]

b. Write a python script to read a file named “story.txt”, count and print total lower case alphabets in the file? [4]
or
Write a function in python to count the number of words in a text file “story.txt” which are starting with alphabet ‘D’ or ‘d’ .

c. Write a function factorial(n) in python to calculate and return the factorial of number n passed as the parameter. [3]

Section B

Q4.

a. Expand the following: [2]
(i). DNS
(ii). TCP/IP
(iii). WAN
(iv). FTP

b. Give the difference between LAN and WAN? [3]

c. Define the following: [2]
(i). Repeater (ii). Router

d. Give one advantage and one disadvantage of optical fibre. [2]

e. What is a cloud computing? [2]

f. Software Development Company has set up its new center at Jaipur

     for its office and web based activities. It has 4 blocks of buildings as shown in     the diagram below: [4]

Center to center distances between various blocks

Black A to Block B : 50 m
Block B to Block C : 150 m
Block C to Block D : 25 m
Block A to Block D : 170 m
Block B to Block D : 125 m
Block A to Block C : 90 m

Number of Computers

Black A 25
Block B 50
Block C 125
Block D 10
(i) Suggest a cable layout of connections between the blocks.
(ii) Suggest the most suitable place (i.e. block) to house the server of this
company with a suitable reason.
(iii) Suggest the placement of the following devices with justification
(i) Repeater
(ii) Hub/Switch
(iv) the company is planning to link its front office situated in the
city in a hilly region where cable connection is not feasible, suggest
an economic way to connect it with reasonably high speed?

SECTION-C

Q.5.

a. Which command is used to display the structure of the table? [1]

b. Which clause is used to sort the records of a table? [1]

c. Which command is used to remove the records of the table? [1]

d. Which clause is used to remove the duplicating rows of the table? [1]

e. Differentiate between Primary key and Candidate key. [2]

f. Answer the questions that follow the given table:[5]

Consider the following tables GARMENT and FABRIC. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii)
TABLE: GARMENT

Gcode

Description

Price

Fcode

Readydate

10023

PENCIL SKIRT

1150

F03

19-DEC-08

10001

FORMAL SHIRT

1250

F01

12-JAN-08

10012

INFORMAL SHIRT

1550

F02

06-JAN-08

10024

BABY TOP

750

F03

07-APR-07

10090

TULIP SKIRT

850

F02

31-MAR-07

10019

EVENING GOWN

850

F03

06-JAN-08

10009

INFORMAL PANT

1500

F02

20-OCT-08

10007

FORMAL PANT

1350

F01

09-MAR-08

10020

FROCK

850

F04

09-SEP-07

10089

SLACKS

750

F03

20-OCT-08

 TABLE: Fabric

FCODE

TYPE

F04

POLYSTER

F02

COTTON

F03

SILK

F01

TERELENE

(i) To display GCODE and DESCRIPTION of each GARMENT in descending order of GCODE.
(ii) To display the average PRICE of all the GARMENTs, which are made up of FABRIC with FCODE as F03.
(iii) To display FABRIC with highest and lowest price of GARMENTS from GARMENT table.
(iv)SELECT SUM(PRICE) FROM GARMENT WHERE FCODE=’F01’;
(v)SELECT COUNT(DISTINCT PRICE) FROM GARMENT;

g. Explain the following SQL group functions with example:[4]
(i). sum()
(ii). Count()
(iii). Max()
(iv). avg()

SECTION-D

Q.6
a. It is an internet service for sending written messages electronically from one computer to another. Write the service name. [1]
b. What can be done to reduce the risk of identity theft? Write any two ways.[2]
c. What do you understand by “privacy of data”? [2]
d. Name the crimes for which cyber laws are enforced strictly in India? [2]
e. If someone hacks your website, who would you complain to?[1]
f. What are the different ways in which authentication of a persom can be performed?[2]

By Rajesh Shukla

Sample Paper 1       Solution Sample Paper 1
Sample Paper 2       Solution Sample Paper 2

CBSE Class 12 @ Python

  • Home Page class 12 @ Python
  • Class 12 @ Python Theory Syllabus
  • Class 12 @ Python Practical Syllabus
  • Revision Tour
  • Functions (Funcations, Inbuilt Functions, Python Modules, Python Packages)
  • Inbuilt Functions
  • Python Modules
  • Python Packages
  • Using Python Libraries
  • Python Data File Handling
  • Program Efficiency
  • Data Structures In Python
  • Data Visualization Using Pyplot
  • Computer Networks
  • MySQL
  • Interface Python with SQL
  • Society, Law and Ethics
  • Web Development with Django
  • Class 12 @ Python Sample Practical File
  • Class 12 @ Python Sample Papers
  • Class 12 @ Python Projects
  • Tutorials

    Technical Questions

    Interview Questions

    C Programming
    C++ Programming
    Class 11 (Python)
    Class 12 (Python)
    C Language
    C++ Programming
    Python

    C Interview Questions
    C++ Interview Questions
    C Programs
    C++ Programs

    Number Of Visitors

    0270440