Professional Documents
Culture Documents
Class 11 IP Support Material
Class 11 IP Support Material
Session 2022-23
Class XI
Informatics Practices
Based on Latest CBSE Exam Pattern
KENDRIYA VIDYALAYA SANGATHAN
CHENNAI REGION
OUR PATRONS
Smt. T RUKMANI
Offg. DEPUTY COMMISIONER
KVS RO CHENNAI
2. Learning Outcomes
2 Introduction to Python 25 35 28 63
Basics of Python programming, Python interpreter - interactive and script mode, the structure of
a program, indentation, identifiers, keywords, constants, variables, types of operators,
precedence of operators, data types, mutable and immutable data types, statements,
expressions, evaluation and comments, input and output statements, data type conversion,
debugging.
Lists: list operations - creating, initializing, traversing and manipulating lists, list methods and
built-in functions.
Dictionary: concept of key-value pair, creating, initializing, traversing, updating and deleting
elements, dictionary methods and built-in functions.
Database Concepts: Introduction to database concepts and its need, Database Management
System.
Relational data model: Concept of domain, tuple, relation, candidate key, primary key, alternate
key
Advantages of using Structured Query Language, Data Definition Language, Data Query
Language and Data Manipulation Language, Introduction to MySQL, creating a database using
MySQL, Data Types
5 Viva-Voce 5
Total 30
Suggested material
NCERT Informatics Practices - Text book for class - XI (ISBN- 978-93-5292-148-5 )
Excluded topics
Nested loop(Chapter -3, Section - 3.13)
Loading and saving NumPy array in text files (Chapter-6, Sections- 6.10 and
6.11)
Unit 1: Introduction to Computer System
Computer System
• A computer is an electronic device that operates according to the instructions
stored in its memory.
Generations of Computer
Input Devices
• Any hardware device that
sends data to the computer,
allowing you to interact with
and control it.
• The most commonly used
or primary input devices on
a computer are the keyboard
and mouse.
Key board
Scanner
A scanner is a device that captures image from
photographic prints, posters, magazine pages and
similar sources for computer editing and display.
Output Devices
• A piece of equipment / hardware
which gives out the result of the entered
input, once it is processed
• The most commonly used or primary
output devices on a computer are Monitor
, speaker, printer, etc .
Monitor
•A monitor is an output device and an electronic
visual computer display that includes a screen,
circuitry and the case in which that circuitry is
enclosed.
•Nowadays, flat-screen LCD monitors are used in
devices like laptops.
Speaker
• Speakers are one of the most common output
device used with computer systems.
• Some speakers are designed to work
specifically with computers, while others can be
hooked up to any type of sound system.
Projector
• A projector is an output device that projects
an image onto a large surface, such as a white screen
or wall.
• It may be used an alternative to a monitor or
television when showing video or images to a large
group of people.
Computer Memory
A computer system needs memory to store the data and instructions for processing.
Units of Memory
➢ A computer system uses binary numbers to store and process data.
➢ The binary digits 0 and 1, which are the basic units of memory, are called bits.
➢ Group of four bits is called nibble.(eg: 1001,1010)
➢ Group of 8 bits is called byte.(eg:10101100)
➢ Bytes are grouped together to make bigger chunks or units of memory
➢
Types of Memory
Computers have two types of memory: Primary memory, Secondary memory
A. Primary Memory
➢ It is an essential component of a computer system.
➢ Program and data are loaded into the primary memory before processing.
➢ The CPU interacts directly with the primary memory to perform read/ write
operation
➢ Two types:
o Random access memory (RAM)
o Read only memory (ROM)
➢ RAM is usually referred to as main memory and it is faster than the secondary
memory or storage devices.
RAM ROM
Random access memory Read only memory
Volatile memory- As the power supply Non-Volatile memory- its contents are
is turned off, all the contents of RAM not lost even when the power is turned
are wiped out. off.
It is used to store data temporarily while Startup program (boot loader) is stored
the computer is working in a ROM
B. Memory
➢ It is high speed memory placed between CPU and RAM, in order to speed up
the operations of the CPU.
o Reason is RAM is not as fast as a computer processor. This makes the
CPU to slow down the processing. To make the processing fast, a high-
speed memory is used. That memory is cache memory
➢ It stores the frequently accessed data. Thus, it reduces the average time
required to access data from primary memory.
C. Secondary Memory
➢ Primary memory has limited storage capacity and that is not enough to store
the data. Thus, a computer system needs another memory to store data
permanently and with large capacity. For that purpose, secondary memory is
used.
➢ The secondary memory stores the data permanently and has larger storage
capacity than primary memory.
➢ It is slower and cheaper than the main memory.
➢ CPU cannot directly access the secondary memory.
➢ Eg: Pendrive, Hard disk, Floppy, CD, DVD
Data Capturing-
➢ It involves the process of gathering data from different sources in digital
form.
➢ Data is captured using keyboard, web cam, sensors, barcode reader etc.
Data storage-
➢ It is the process of storing the captured data for processing later.
➢ Huge amount of data is generating every time, so the storage devices also
require to be upgraded periodically
➢ Data servers are used in large organizations for storing the data.
Data Retrieval
➢ It involves fetching data from the storage devices, for its processing as per the
requirement.
➢ Minimizing the data access time is crucial factor for retrieval of data.
Data deletion and recovery
Two security concerns associated with data:
➢ Deletion by some unauthorised person or software
o This can be avoided by using passwords or encrypting the files
➢ Unwanted recovery of data by unauthorised user/software
o While discarding old, broken or malfunctioning storage devices, make
sure that the data is deleted.
SOFTWARE
➢ Software is set of programs that governs the operation of a computer system and
makes the hardware run.
➢ The sole purpose of a software is to make computer hardware useful and
operational.
➢ software acts as an interface between human users and the hardware.
System software:
➢ Software that controls the internal computer operations are called system
software.
➢ system software includes operating systems, system utilities, device drivers,
Interactive Mode
Interactive mode is running blocks or a single line of Python code. The code executes
via the Python shell. Interactive mode is handy when you just want to execute basic
Python commands or you are new to Python programming.
Script Mode
If you need to write a long piece of Python code or your Python script spans multiple
files, interactive mode is not recommended. Script mode is the way to go in such
cases. In script mode, You write your code in a text file then save it with a .py
extension which stands for "Python". This file can be executed by Python Interpreter
later on.
Python Keywords
Python keywords are special reserved words that have specific meanings and
purposes and can’t be used for anything but those specific purposes. An example of
something you can’t do with Python keywords is assign something to them.
Examples of keywords are : False, else, import, pass, in, is, True, and continue etc.
Python Identifiers
Text : Str
Numeric: int, float, complex
Sequence : list, tuple, dict
Set :set
Boolean : bool (Only True and False Value)
None
PYTHON OPERATORS
Operators are used to perform operations on variables and values. In the example
below, we use the + operator to add together two values: Python divides the
operators in the following groups:
• Arithmetic operators
• Assignment operators
• Comparison operators
• Logical operators
• Identity operators
• Membership operators
• Bitwise operators
PYTHON ARITHMETIC OPERATORS
Arithmetic operators are used with numeric values to perform common
mathematical operations:
not Reverse the result, returns False if the result is true not(x < 5 and x < 10)
Python Mutable data types are those whose values can be changed in place whereas
Immutable data types are those that can never change their value in place.
Example
#function int() to convert string to integer
>>> age = int(input("Enter your age: "))Enter your age: 19
>>> type(age)
<class 'int'>
Python uses the print() function to output data to standard output device
— the screen. The function print() evaluates the expression before displaying
it on the screen. The syntax for print()is:
print(value)
Example
print("Hello") Output: Hello
CONTROL STATEMENTS IN PYTHON
A program’s control flow is the order in which the program’s code executes. Thecontrol
flow of a Python program is regulated by conditional statements, loops,and function
calls.
Python has three types of control structures:
• Sequential - default mode
multipletimes.
1. SEQUENTIAL
Sequential statements are a set of statements whose execution process happens in a
sequence. The problem with sequential statements is that if the logic has broken in any
one of the lines, then the complete source code execution will break.
num = -1
if num > 0:
print(num, "is a positive number.")print("This is also always printed.")
if-else
The if-else statement evaluates the condition and will execute the body of ‘if’, if the
test condition is True, but if ‘ i f ’ the condition is False, then the body of else is
executed.
#Take user input and find whether number is odd or even
inp_num = input("Enter a number: ") #Convert string to int
inp_num = int(inp_num)
if inp_num == 0:
print(inp_num, "is Even")
elif inp_num%2==0:
print(inp_num, "is Even")
else:
print(inp_num, "is Odd")
if-elif-else:
The if-elif-else statement is used to conditionally execute astatement or a
block of statements.
# '''In this program, we check if the number is positive or negative or zero and
display an appropriate message'''
num = 3.4
# Try these two variations as well:
# num = 0
# num = -4.5
if num > 0:
print("Positive number")elif num == 0:
print("Zero")
else:
print("Negative number")
Nested if:
Nested if statements are an if statement inside another if statement.
#'''In this program, we input a number check if the number is positiveor negative
or zero and display an appropriate message This time we use nested if statement'''
Note: Body of the loop is indented with respect to the for statement.
• Syntax 1:
• Syntax 2:
Sum = 0
for num in range(1, 6, 1):
Sum += num
print(Sum)
LIST
A list is a standard data type of python that can store a sequence of values
belonging to any type. List are mutable. You can change elements of a list in place.
Following are some lists in python:
[] empty list
[1, 2, 3] list of integers
[‘a’, 1,’b’,2] list of mixed values
[1, 2, [10, 20], 5, 6] Nested list
List Functions– Python also offers many built-in functions and methods for list
manipulation. These can be applied to list as per following syntax :
<listobject> . <method name> ( )
• append() – It adds a single item to the end of the list .
Syntax: list. append(<item>)
>>>l1 =[1,2,3]
>>>l1. append(4)
>>>print(l1)
[1, 2, 3, 4]
>>> l1. append([5,6])
>>>print(l1)
[1, 2, 3, 4, [5, 6] ]
• index() - It returns the index of first matched item from the list.
Syntax: list. index(<item>)
>>>l1 =[1,2,3]
>>> l1. index(3)
2
• extend() –It is used for adding multiple elements to a list.
Syntax: list. extend(<list>)
>>>l1 =[1,2,3]
>>>l1. extend([5, 6])
>>>print(l1)
[1, 2, 3, 5, 6]
• insert() – It is used to insert an item at a given position.
Syntax : list. insert( <pos> , <item> )
>>>l1 =[1,2,3]
>>>l1.insert(0, -9)
>>>print(l1)
[-9, 1, 2, 3]
• pop() - It is used to remove am item of the given index from the list. By
default, item with index -1, that is last element will be removed
Syntax : list. pop(<index>)
>>>l1 =[1,2,3]
>>>l1. pop()
3
>>>l1. pop(0)
1
• remove()-It is used to remove the first occurrence of given item from the
list.
Syntax : list. remove(<value>)
>>>l1 =[1,2,3]
>>>l1. remove(2)
>>>print(l1)
[1, 3]
>>>l1. remove(5)
ValueError
• clear()-It is used to remove all the items from the list and the list becomes
empty.
Syntax : list. clear()
>>>l1 =[1,2,3]
>>>l1.clear()
>>>print(l1)
[]
• count()-This function returns the count of the item passed as a parameter.
Syntax : list. count(<item>)
>>>l1 =[1,2,1,3,5]
>>>l1.count(1)
2
>>>l1.count(4)
0
• reverse()–It will reverse the items of the list.
Syntax: list. reverse()
>>>l1 =[1,2,3]
>>>l1.reverse()
>>>print(l1)
[3,2,1]
• sort()-It will sort the items of the list in increasing order by default.
Syntax : list. sort()
>>>l1 =[1,2,4,3,-2]
>>>l1.sort()
>>>print(l1)
[-2, 1, 2, 3, 4]
>>>l2=[90,34,26,180]
>>>l2.sort(reverse=True)
>>>print(l2)
[180, 90, 34, 26]
>>>l3=[‘a’, ‘s’, ‘c’, ‘i’]
>>>l3.sort()
>>>print(l3)
[‘a’, ‘c’, ‘i’, ‘s’]
LIST MANIPULATION:
1. Updating elements from the list – By assigning new value to the element of
the list through its index will change an element. Ex:
>>>l1 =[1,2,3]
>>>l1[2] = 4
>>>l1
[1,2,4]
2. Deleting elements from the list – the del statement is used to remove an
individual item, or to remove all items identified by a slice.
>>>l1=[10,12,13,14]
>>>del l1[2]
l1
[10,12,14]
3. Slicing the list – Like string a subpart of the list will be displayed.
>>>l1=[10,12,14,20,22,24,30,32,34]
>>>s=l1[3 :-3]
s
[20, 22, 24]
4. Joining lists-The concatenation operator + when used with two lists, joins two
lists together
>>>l1=[1,2,3]
>>>l2=[4,5,6]
>>>l1+l2
>>>[1,2,3,4,5,6]
5. Replicating Lists-The * operator replicate a list specified number of times.
>>>l1=[1,2]
>>>l1*2
>>>[1,2,1,2]
List manipulation programs
• Program for printing only the odd numbers of the given list
m = [2, 7, 8, 3, 5, 9, 0]
for val in m:
if val%2!=0:
print(val)
• Program for finding the sum of all even numbers in a given list
k = [9, 4, 8, 2, 14, 2]
Sum_even=0
for val in k:
if val%2==0:
Sum_even+=val
print(“Sum of all the even numbers in the given list is”, Sum_even)
DICTIONARY
Dictionaries are a collection of some key-value pairs. Dictionaries are
mutable, unordered collections with elements in the form of a key: value pairs that
associates keys to values. The syntax to create a dictionary is :
<dictionary-name> = {<key> : <value> , <key> :<value>...............}
Ex: emp = {‘salary’ : 10000 , ‘age’ :24 , ‘name’ : ‘john’ }
>>>emp.keys()
[‘salary’, ’age’, ’name’]
>>>emp.values()
[10000,24,’john’]
DATABASE CONCEPTS
➢ Database
A database is a place where bulk amount of interrelated data is stored in an organized
way, so that it can be easily accessed and managed.
➢ Relational Database - A database where data are organized in the form of tables
(rows and columns)
Terminologies in RDBMS
➢ Candidate keys - Set of attributes which are eligible to become primary key
Eg:candidate(employee)={Empid, Ename}
✓ CREATE: This command is used to create the database or its objects (like table,
index, function, views, store procedure, and triggers).
Char datatype is used to store character Varchar datatype is used to store character
strings of fixed length. strings of variable length.
Char datatype can be used when we expect Varchar datatype can be used when we
the data values in a column to be of same expect the data values in a column to be of
length. variable length.
The mandatory semi-colon at the end of the statement is used to process every
command before it. In this example, the string CHAR is used to specify the data
type. Other data types can be DATE, NUMBER, or INTEGER.
NOT NULL - to define that column will not accept null values.
A table may have multiple UNIQUE constraints but only one PRIMARY KEY is
allowed.
Example:
CREATE TABLE Student
(Code char(3) NOT NULL PRIMARY KEY,
name char(20) NOT NULL,
AdmNo char(5) UNIQUE,
Gender char(1) DEFAULT ‘M’,
Age integer CHECK (Age>=10),
Stream char(1) CHECK Stream IN (‘S’, ‘C’, ‘H’) );
SHOWING TABLES USING MySQL
To see the names of all the tables in the database, At any point of time, we can view
names of all the tables contained in the current database by using SHOW TABLES
statement as shown below:
mysql> SHOW TABLES;
INSERT command:
This command is used to insert new rows into an existing table.
SYNTAX:
INSERT INTO tablename VALUES(value 1, value 2,....);
Here, value 1, value 2 etc. correspond to values of attributes.
Examples:
mysql>INSERT INTO student values(15,‘Harsh’,1234,’M’,15,’S’);
We can insert record with specific column only
mysql>INSERT INTO student( Code, name, gender) values(15,’Harsh’,’M’);
SELECT Command:
With the SELECT command we can retrieve previously inserted rows.
A general form of SELECT is:
SELECT columnnames FROM table_name;
Example: SELECT * FROM Student;
SELECT name, stream FROM Student;
WHERE Clause:
The WHERE clause is used to retrieve data that satisfy the specified conditions.
With WHERE clause the following operators can be used:
• Comparison operators are: < <= = != <> >= >
• Logical operators are: AND OR NOT
• Comparison operator for special value - NULL IS NULL
Examples:- SELECT * FROM Student WHERE Age < 18 ;
SELECT name FROM Student WHERE stream = ”S” AND gender=’M’;
SELECT name, age, stream FROM Student WHERE Stream=’C’ OR Age>12;
Unit 4: EMERGING TRENDS
Artificial Intelligence
Artificial Intelligence (AI) basically refers to the ability of a machine or a computer
program to think and learn. In simple words, field of AI revolves around bringing
out technologies that help build machines that can think, act, and learn like humans.
An Al based program and technology should capable of:
• It should be able to mimic human thought process and behaviour e.g., learning
from
mistakes, catching up with new ideas, learning new things from new exposure,
past experiences (this ability is called heuristics.) etc.
• It should act in a human-like way - intelligent, rational, ethical, i.e. it should
take right decisions in ethical ways.
Applications of AI
• Handwriting Recognition
• Gaming
• Intelligent Robots
• Natural Language Processing etc.
Common examples of Al today are:
• Humanoid Robot - Sophia
• Siri or Alexa - the personal assistant
• Google’s NEST - is a line of smart home products including smart speakers,
smart displays, streaming devices, thermostats, smoke detectors etc.
• Self-Driving cars like Tesla.
• Online games like Alien: Isolation
Machine Learning
• Machine Learning is a subsystem of Artificial Intelligence, wherein
computers have the ability to learn from data using statistical techniques,
without being explicitly programmed by a human being.
• It comprises algorithms that use data to learn on their own and make
predictions.
• These algorithms, called models, are first trained and tested using a training
data and testing data, respectively.
• After successive trainings, once these models are able to give results to an
acceptable level of accuracy, they are used to make predictions about new and
unknown data.
Fig: VR Headset
Augmented reality
• The superimposition of computer generated perceptual information over the
existing physical surroundings is called as Augmented Reality (AR).
• It adds components of the digital world to the physical world, along with the
associated tactile and other sensory requirements, thereby making the
environment interactive and digitally manipulatable.
Robotics
• A robot is basically a machine capable of carrying out one or more tasks
automatically with accuracy and precision.
• A robot is programmable.
• Used for doing repetitive industrial tasks that are boring or stressful for
humans or were labour-intensive.
• Sensors are one of the prime components of a robot.
• Robot can be of many types, such as wheeled robots, legged robots,
manipulators and humanoids.
• Robots that resemble humans are known as humanoids.
• Robots are being used in industries, medical science, bionics, scientific
research, military, etc.
• Some examples are:
o NASA’s Mars Exploration Rover (MER) mission is a robotic space
mission to study about the planet Mars.
o Sophia is a humanoid that uses artificial intelligence, visual data
processing, facial recognition and also imitates human gestures and
facial expressions.
Big data and its characteristics
• Data sets of enormous volume and complexity are called Big Data.
• Such data cannot be processed and analysed using traditional data processing
tools as the data is not only voluminous, but also unstructured like our posts,
instant messages and chats, photographs that we share through various sites,
our tweets, blog articles, news items, opinion polls and their comments,
audio/video chats, etc.
• It also involves various challenges like integration, storage, analysis,
searching, processing, transfer, querying and visualisation of such data.
• A smart sensor is a device that takes input from the physical environment and
uses built-in computing resources to perform predefined functions upon
detection of specific input and then process data before passing it on.
• Sensors are very commonly used for monitoring and observing elements in
real world applications.
• Example: What happens when you hold your mobile vertically or
horizontally?
The display also changes to vertical or horizontal with respect to the way we
hold our mobile. This is possible with the help of two sensors, namely
accelerometer and gyroscope (gyro). The accelerometer sensor in the mobile
phones detects the orientation of the phone. The gyroscope sensors tracks
rotation or twist of your hand and add to the information supplied by the
accelerometer.
Smart Cities
Blockchains
• Traditionally, we perform digital transactions by storing data in a centralised
database and the transactions performed are updated one by one on the
database. That is how the ticket booking websites or banks operate. However,
since all the data is stored on a central location, there are chances of data being
hacked or lost.
• The blockchain technology works on the concept of decentralised and shared
database where each computer has a copy of the database.
• A block can be thought as a secured chunk of data or valid transaction.
• Each block has some data called its header, which is visible to every other
node, while only the owner has access to the private data of the block. Such
blocks form a chain called blockchain.
• We can define blockchain as a system that allows a group of connected
computers to maintain a single updated and secure ledger. Each computer or
node that participates in the blockchain receives a full copy of the database.
• It maintains an ‘append only’ open ledger which is updated only after all the
nodes within the network authenticate the transaction. Safety and security of
the transactions are ensured because all the members in the network keep a
copy of the blockchain and so it is not possible for a single member of the
network to make changes or alter data.
• Popular application of blockchains technology is in digital currency.
Worksheet
Unit 1: Introduction to computer system (Level 1)
1 Which of the following is used to hold the running program instructions?
(i) Primary Storage (ii) Virtual Storage
(iii) Internal Storage (iv) Minor Device
1 i
2 c
3 bit
4 a. barcode reader-input
b. web cam-input
c. plotter-output
d. speaker-output
5 ALU: arithmetic and logic unit
CPU-Central processing unit
6 b
7 Nibble
8 OS stands for operating system. It acts as an interface between user and the
computer hardware.
Eg: Windows, Linux
10 RAM ROM
Random access memory Read only memory
Volatile memory Non-Volatile memory
It is used to store data temporarily Startup program (boot loader) is
while the computer is working stored in a ROM
Temporary storage Permanent storage
Answers for Worksheet (Level 2)
1 b
2 a
3 a. Free and open source
b. Proprietary
c. Freeware
d. Free and open source
4 a. System software
b. Application software
c. Application software
d. System software
5 c
6 b
7 Artificial Intelligence
8 RAM is not as fast as a computer processor. This makes the CPU to slow
down the processing. To make the processing fast, a high-speed memory
is used. That memory is cache memory. It is placed between CPU and
RAM.
9 Primary memory has limited storage capacity and that is not enough to
store the data. Thus, a computer system needs another memory to store data
permanently and with large capacity. For that purpose, secondary memory
is used.
Eg: hard disk, CD
10 General purpose software: These are ready to use software for daily use
purpose. Eg: spread sheet
Specific purpose software: These are custom or tailor-made application
software, that are developed to meet the requirements of a specific
organisation or an individual
Eg: Banking software
Answers for Worksheet (Level 3)
1. c
2 c
3 c
4 d
5 c
6 Free and open-source software
7 MICR
8 ➢ Deletion by some unauthorised person or software
o This can be avoided by using passwords or encrypting the
files
➢ Unwanted recovery of data by unauthorised user/software
o While discarding old, broken or malfunctioning storage
devices, make sure that the data is deleted
10 Freeware:-software is freely available for use but source code may not be
available.
Eg: Skype
proprietary software: - When software to be used has to be purchased
from the vendor who has the copyright of the software is called
proprietary software
Eg: Microsoft Windows
PYTHON FUNDAMENTALS
ASSIGNMENTS - L1
1. What are literals in Python? How many types of literals are there in Python?
2. How string literal is represented in Python?
3. What is a statement and expression?
4. What is the role of indention in Python?
5. What are variables?
6. What is dynamic typing in python?
7. Differentiate keyword and identifier.
8. What are tokens in Python?
9. What will be the output of following?
a=20
b=33
print(a+b)
10. What is wrong with following code fragment?
a=20
c=a+b
print(c)
2. Which data type will be used to represent the following data values and
why?
a) Number of months in a year
b) Resident of Delhi or not
c) Mobile number
d) Pocket money
e) Volume of a sphere
f) Perimeter of a square
g) Name of the student
h) Address of the student
a) 25 / 0
b) num1 = 25; num2 = 0;
num1/num2
5. Write a Python program to calculate the amount payable if money has
been lent on simple interest. Principal or money lent = P, Rate = R% per
annum and Time = T years. Then Simple Interest (SI) = (P x R x T)/
100.
Amount payable = Principal + SI.
P, R and T are given as input to the program.
a) for i in range(20,30,2):
print(i)
b) country = 'INDIA'
for i in country:print (i)
c) i = 0; sum = 0
while i < 9:
if i % 4 == 0:
sum = sum + ii = i + 2
print (sum)
DATA HANDLING
WORKSHEET L3
1. How many parts are there for any complex number?
2. What is data type in python? Is there any importance of data type?
3. Differentiate mutable and immutable data types? List them.
4. List the augmented assignment operator supported by python.
5. What is the output of the
following code :print(9//2)
6. Can you identify the data types of following values, if yes write their data
type.[4,5,2] , {2,34,5} , (4,23,55) , {33,4,4) , 4, 5.2, 8j , ’1’ , ”1” , 4+0j
7. Is Boolean is a subtype of integers?
8. Write the names of python built in data types.
9. What will be the output of the following
codeprint(5/2)
print(5//2)
10. What will the output of following
codesprint (8*2 - 2*4)
print (3 + 18/9 -
3**2+1) print ((4 +
24)/8 - (2**3+3))
11. What will the output of following code
snippetx = 5
y = -1
print ((x+y)*1./x)
print
(3*x )
print (x )
12. Write the python programs for following formulas
17. Write a Python program to find out the area of the triangle.
# Three sides of the triangle is a, b and c:
a = float(input('Enter first side: '))
b = float(input('Enter second side: '))
c = float(input('Enter third side: '))
# calculate the semi-perimeter.
s = (a + b + c) / 2.
# calculate the area.
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5.
print(“area= ”,area)
19. Write a Python program to find out the area of the circle.
r=int(input("Enter radius of circle"))
a=(22/7)*r*r
print("Area is : ", a)
1)SOLUTION:
a)length,breadth=10,20
b)sum=(length+breadth)/2
c)stationary=[‘Paper’,’Gel pen’ ,’Eraser’]
d)first,middle,last=”Mohandas”, “Karamchand”, “Gandhi”
e)fullname = first + “ “ + middle+ “ “ + last
2) Solution
a) Number of months in a year = int as it can’t be string or float
b) Resident of Delhi or not = boolean as it is a condition like ‘either or’
c) Mobile number = int as it can’t be float or string
d) Pocket money = float as it can be a decimal value i.e. 10.50
e) Volume of a sphere = float as volume of sphere = 4/3( * r3), value of = 3.14 and r value can
be decimal i.e. 4.5 unit
f) Perimeter of a square = float as perimeter = 4 * length of side, the length of side can be a
decimal value
g) Name of the student = string as name is combinations of characters
h) Address of the student = string as address is the concatenated form of different strings.
3) Solution
a. 9
Explanation:
num1 = num1 + 3 + 2 = 4 + 3 + 2 = 9
Therefore, print(num1) will give the output 9.
b. 1024
Explanation:
num1 = 4 ** (3 + 2) = 4 ** 5 = 1024
Therefore, print(num1) will give the output 1024
c. 1024
Explanation:
num1 **= (3 + 2)
num1 = num1 ** 5
num1 = 4 ** 5
num1 = 1024
Therefore, the output will be 1024.
d. 55
Explanation:
Everything written inside ‘’ considered as string and in case of string ‘+’ is used for string
concatenation.
e. 1.0
Explanation:
The numbers written in the statement are in float data type therefore, the output will be also in
float data type.
print(4.00/(2.0 + 2.0))
print(4.0/4.0)
f. 27.2
Explanation:
num1 = 2 + 9 * (36 - 8) /10
num1 = 2 + 9 * 28/10
num1 = 2 + 252/10
num1 = 2 + 25.2
num1 = 27.2
Therefore, the output will be 27.2.
g. 3
Explanation:
num1 = 6 // 2 #When floor division is used, return value will be int data type num1 = 3
Therefore, the output will be 3
h. 10.0
Explanation:
float(10) will convert integer value to float value and therefore, the output will be 10.0.
i. Runtime error as we cannot pass string representation of float to an int function.
j. False
Explanation:
As Python compares string character to character and when different characters are found then
their Unicode value is compared. The character with lower Unicode value is considered to be
smaller. Here, 'y' has Unicode 121 and 'Y' has 89. Therefore, the output will be 'False'.
4) Solution:
a) 25/0 : Runtime Error (ZeroDivisionError)
b) num1=25; num2=0; num1/num2 : Runtime Error(ZeroDivisionError)
5)p=float(input(‘Enter Principal:’))
r= float(input(‘Enter Rate of interest:’))
t=float(input(‘Enter Time(years):’))
simple_interst=(p*r*t)/100
amount_payable=p+simple_interest
print(“amount to be paid:”,amount_payable)
7) Program:
a = int (input(" Please Enter the First Number: "))
b = int (input(" Please Enter the second number: "))
c = int (input(" Please Enter the third number: "))
average=(a+b+c)/3.
print("The average of three numbers is ", average)
Output:
Please Enter the First Number: 3
Please Enter the second number: 5
Please Enter the third number: 1
The average of three numbers is 3
9) Else’ is used along with ‘if’ to define the alternative path if the condition mentioned in
the ‘if’ statement is incorrect. This means that only one statement can be evaluated using
if else statement.
If more than one statements need to be evaluated, ‘elif’ construct is used. There is no limit
on the number of ‘elif’ construct which should be used in a statement. However, the
conditions mentioned in each ‘elif’ construct should be mutually exclusive i.e. if one of
the conditions in elif is correct, it stops and doesn’t evaluate the rest.
Else assesses a solitary articulation before shutting the loop. Elif permits you to assess
various explanations before shutting the loop.
10)(a)
20
22
24
26
28
(b)
I
N
D
I
A
(c)
12
DATA HANDLING
WORKSHEET L3- Solutions
6. Can you identify the data types of following values, if yes write their data
type.[4,5,2]- List , {2,34,5}-Set , (4,23,55)-Tuple , {33,4,4)-invalid , 4-
Int, 5.2-float, 8j-complex , ’1’-string , ”1”-string , 4+0j-complex
Cylinder V=b*h
Volume Cone V=b*h/3
sphere V=(4/3)*(22/7)*r**3
Circumference Circle C=2*22/7*r
Square A=a*a
rectangle A=l*b
Area Triangle A=(1/2)*b*h
Trapezium A=(b1+b2)*h/2
Circle A=(22/7)*r*r
Square S=6*a**2
Cylinder S=2*(22/7)*r*h
Surface area
Cone S=(22/7)*r*l
Sphere S=4*(22/7)*r*r
Square P=4*a
Perimeter
Rectangle P=2*(l+b)
13. Write the equivalent Boolean value
a. 7+3*4<3*3+4 #False
b. 4+3*4==3*3+7 #True
14. What is the problem with following code fragments
a. x="marks"+100
print(x)
Sol: String cannot be added with integer
b. a=5
b=a+500
a="mark
s"c=a/2
print(c)
Sol: Srtring cannot be divided
20. Find out the compound interest of entered amount, rate and time through
python program.
p=int(input("Enter Principal amount"))
r=int(input("Enter rate"))
t=int(input("Enter time"))
CI=(p*(1+r/100)**t)-p
print("Compound Interest is : ", CI)
Worksheet
For loop (Level 1)
1. How many times will the value “Best” be printed, on executing the following codes
(a) and (b)?
(a) for I in range(0, 2):
print(“Best”)
1. How many times will the value “Best” be printed, on executing the following codes
(a) and (b)?
(a) for I in range(25, 5, -10):
print(“Best”)
For x in range(2):
For y in range(2):
print(x,y)
Worksheet
List (Level 1)
1. What is the output of print list[0] if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?
2. What is the output of print tinylist * 2 if tinylist = [123, 'john']?
3. What is the output of print list[2:] if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?
4. What do you understand by list ?
5. What is a nested list ?
Worksheet
List (Level 2)
1. Write a short note on indexing in a list
2. Predict the output based on the list, cod = [98, 45, 62, 14, 1007]
a. print(len(cod))
b. print(cod * 2)
c. print(1007 in cod)
d. print(cod[:2]+cod[2:])
e. cod. append(1010)
print(cod)
f. print(cod. pop(1))
3. The record of a student is stored as a list in the following format(Name, Roll.No,
Marks in 3 subjects, Percentage)
RecordList = [‘Komal’, ‘A-19’, [71, 86, 72], 76.3]
Write Python statements to retrieve the following information from the list, RecordList
a. Name of the student
b. Mark in the first subject
c. Percentage obtained
d. Change the name of the Student from “Komal” to “Kunal”
4. Write a program to accept elements of a list from the user. Multiply all the elements
of the list with 7 and display the elements.
5. Consider the following list, p = [‘v’, ‘a’, ‘c’, ‘c’, ‘i’, ‘n’, ‘a’, ‘t’, ‘i’, ‘o’, ‘n’).
Write a program to display each character along with its positive index and negative
index
Worksheet
List (Level 3)
7. Predict the output based on the list, cod = [98, 45, 62, 14, 1007]
a. print(len(cod+cod))
b. print(cod[2:4] * 3)
c. print(‘14’ not in cod)
d. print(50-5 in cod)
e. print(cod[::-1]+cod[0:1])
f. cod. extend([10, 11])
print(cod)
g. cod. insert(2, 3)
print(cod)
h. print(cod. pop())
9. Write a program to accept elements of a list from the user. Multiply elements of the
list with 7, if an element is a multiple of 7 otherwise multiply each element with 4.
After processing, display the elements.
10.Consider the following list, p = [‘v’, ‘a’, ‘c’, ‘c’, ‘i’, ‘n’, ‘a’, ‘t’, ‘i’, ‘o’, ‘n’). Write a
program to display each character along with its frequency of occurrence, and also
excluding duplicates from displaying multiple times.
Worksheet
Dictionary (Level 1)
1. Predict the output of
i. dict = {(3,4,8):4,(5,6,9):3}
ii. print('output:',dict[5,6,9])
1. Write a python statement to add a new key, 11 and corresponding value “Eleven”
to the dictionary, “ODD “
2. Consider the following dictionary cpwords:
cpwords = {"Soil": "Pollution", "Traffic": "Jam", "Air": "Purifier", "Play": "Ground"}
Find the output of the following statements
a. print(cpwords[‘Soil’])
b. print(cpwords. keys())
c. print(cpwords. values())
d. cpwords. update({"Play": "Station"})
print(cpwords)
e. del cpwords["Traffic"]
print(cpwords)
f. cpwords. update({"Water" : "Conservation"})
print(cpwords)
5. Write a Python program that can accept a month’s number( from 1 to 12) and
display the number of days in the given month, based on an existing dictionary
month, which has number of the month as keys and the number of days as values.
Worksheet
Dictionary (Level 3)
6. Write a python statement, to delete the item from the dictionary corresponding to
the key 9 of the following dictionary,
ODD = {1:'One',3:'Three',5:'Five',7:'Seven',9:'Nine'}
7. a, b = 0,1
n = int(input(“Enter a number”))
print(a, “ “, b, end=” “)
for i in range(1, n):
c = a+b
print(c, end=” “)
a=b
b=c
8. c – 10
10.20 : 17
39 : 19
39 , 19
For loop – Level 3
List – Level 1
1. What is the output of print list[0] if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?
Ans: abcd
2. What is the output of print tinylist * 2 if tinylist = [123, 'john']?
Ans: [123,’john’,123,’john’]
3. What is the output of print list[2:] if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?
Ans: [2.23,’john’,70.2]
4. What do you mean by list
Ans: A list is the data structure which is mutable and ordered sequence
of elements
5. What do you mean by nested list
Ans: A list inside another the list is known as nested list
List – Level 2
1. Each element in list is accessed using value called index.
• The first index value is 0, the second index is 1 and so on.
• Elements in the list are assigned index values in increasing order sterling from 0.
• To access an element, use square brackets with the index [] value of that element.
• We may also use negative index value to access elements starting from the last
element in the list, having index value -0.
Eg: L=[1, 2, 3, 4, 5]
print(L[0]) will display 1 and print(L[-1]) will display 5
2.
a. 5
b. [98, 45, 62, 14, 1007, 98, 45, 62, 14, 1007]
c. True
d. [98, 45, 62, 14, 1007]
e. [98, 45, 62, 14, 1007, 1010]
f. 45
3.
a. RecordList[0]
b. RecordList[2][0]
c. RecordList[-1]
d. RecordList[0]=”Kunal”
5. pos_index = 0
neg_index = -1
for val in p:
print(val, “Positive index=”, pos_index, “Negative index=”, neg_index)
pos_index +=1
neg_index -=1
List – Level 3
6. List vs Dictionary
• Lists are mutable ordered sequences of values while Dictionaries are mutable
unordered collection with items in the form of key-value pairs.
• List value can be accessed with indices, whereas dictionary values are accessible
with the keys.
Eg: L=[1, 2, 3, 4, 5]
D = {1:’one’, 2:’two’, 3:’three’}
7.
a. 10
b. [62, 14, 62, 14, 62, 14]
c. True
d. True
e. [1007, 14, 62, 45, 98, 98]
f. [98, 45, 62, 14, 1007, 10, 11]
g. [98, 45, 3, 62, 14, 1007, 10, 11]
h. 11
8.
a. RecordList[3] (or) RecordList[-1]
b. Sum(RecordList[2])
c. max(RecordList[2])
d. m1=RecordList[2]
Dictionary – Level 2
1. ODD[11] = “Eleven”
2.
a. Pollution
b. dict_keys["Soil", "Traffic", "Air", "Play"]
c. dict_values["Pollution", "Jam", "Purifier", "Ground"]
d. {"Soil": "Pollution", "Air": "Purifier", "Play": "Ground"}
e. {"Soil": "Pollution", "Traffic": "Jam", "Air": "Purifier", "Play": "Station"}
f. {"Soil": "Pollution", "Air": "Purifier", "Play": "Ground", "Water":
"Conservation"}
3.
a. ‘s1’ in PTM
b. PTM. clear()
c. len(PTM)
d. PTM[‘s5’]=99
e. min(PTM)
4. Stu_mark={}
for i in range(5):
name = input(“Enter the name of the student”)
mark = int(input(“Enter the mark obtained”))
Stu_mark[name] = mark
print(Stu_mark)
5.
month={1: 31, 2: 28, 3: 31, 4: 30, 5: 31, 6:30, 7: 31, 8: 31, 9: 30, 10: 30, 11:30,
12: 31}
mon = int(input(“Enter the number of the month”))
if mon in month:
d = month[m1]
print(mon, “has”, d, “days”)
else:
print(“Enter a valid month name”)
Dictionary – Level 3
6. del ODD[9]
7.
a. Purifier
b. True
c. True
d. {"Soil": "Pollution", "Air": "Purifier", "Play": "Ground", "play": "Station" }
e. KeyError
8.
a. ‘s1’ in PTM. values()
b. for key in PTM:
if PTM[key]==93:
del PTM[key]
c. PTM. update(d2)
d. min(PTM. values())
e. PTM. update({‘s8’: 74})
9. Stu_mark={}
for i in range(5):
name = input(“Enter the name of the student”)
mark = int(input(“Enter the mark obtained”))
Stu_mark[name] = mark
Name1 = input(“Enter a name for searching”)
if Name1 in Stu_marks:
print(Stu_marks[Name1])
else:
print(“No such student exists..”)
10.
month={‘january’: 31, ‘february’: 28, ‘march’:31, ‘april’: 30, ‘may’: 31, ‘june’:30,
‘july’: 31, ‘august’: 31, ‘september’: 30, ‘october’: 30, ‘november”:30,
‘december’: 31}
mon = input(“Enter the name of a month”)
m1 = mon. lower()
if mon in month:
d = month[m1]
print(mon, “has”, d, “days”)
else:
print(“Enter a valid month name”)
UNIT- 3 - Database concepts and the Structured Query Language
WORKSHEET
L1 QUESTIONS
1. What is the full form of DBMS?
a) Data of Binary Management System
b) Database Management System
c) Database Management Service
d) Data Backup Management System
2. What is a database?
a) Organized collection of information that cannot be accessed, updated, and
managed
b) Collection of data or information without organizing
c) Organized collection of data or information that can be accessed, updated,
and managed
d) Organized collection of data that cannot be updated
3. What is a DBMS?
4. What is a RDBMS?
5. What is a Relation?
6. What is Domain?
7. What is a Tuple?
8. What is an Attribute?
9. What is Degree?
10.What is Cardinality?
11.What is a Primary Key?
12.What is a Candidate Key?
13.What is a Alternate Key?
14.Write the command to create database.
15.Write command to open database.
16.Write a command to display all details of table EMP.
L2 QUESTIONS
7. Consider the table EMP with attributes(Empno, Ename, DName, Job, DOJ,
Location).
Write a command to insert values {1254, Ramesh, HR, Manager, 12-10-2010,
Chennai} into employee table .
8. Consider the table EMP with attributes(Empno, Ename, DName, Job, DOJ,
Location).
Write a command to display name of employee with their job type.
9. Consider the table EMP with attributes(Empno, Ename, DName, Job, DOJ,
Location). Write a command to display all details of table EMP whose JOB
type is CLERK.
2. Consider the table Employee, identify the primary key, alternate keys and
candidate keys. The attributes are as follow:
Ans: b)
2. What is a database?
a) Organized collection of information that cannot be accessed, updated, and
managed
b) Collection of data or information without organizing
c) Organized collection of data or information that can be accessed, updated,
and managed
d) Organized collection of data that cannot be updated
Ans: c)
3. What is a DBMS?
Ans: A DBMS refers to a software that is responsible for
storing, maintaining and utilizing database in an efficient way.
4. What is a RDBMS?
Ans: A relational database is a collective set of multiple data sets organized
by tables, records and columns.
5. What is a Relation?
Ans: A Relation also called Table, is Matrix like structure arranged in Rows
and Columns.
6. What is Domain?
Ans: It is collection of values from which the value is derived
for a column.
7. What is a Tuple?
Ans: Rows of a table is called Tuple or Record.
8. What is an Attribute?
Ans: Column of a table is called Attribute or Field.
9. What is Degree?
Ans: Number of columns (attributes) in a table.
L2 QUESTIONS
Ans: c)
Ans: d)
Ans: c)
9. Consider the table EMP with attributes(Empno, Ename, DName, Job, DOJ,
Location). Write a command to display all details of table EMP whose JOB
type is CLERK.
Ans: SELECT * FROM EMP WHERE JOB=’CLERK’;
10. Write a command to display name of employees whose location is
CHICAGO.
L3 QUESTIONS
1. The logical design, and the snapshot of the data at a given instant in time is
known as?
a) Instance & Relation
b) Relation & Schema
c) Domain & Schema
d) Schema & Instance
Ans: d)
2. Consider the table Employee, identify the primary key, alternate keys and
candidate keys. The attributes are as follow:
Ans:
Primary Key: Emp_Id (Note: it can be Aadhar_no/Mobile no also)
Alternate Key: Aadhar_no and Mobile no (Note: when primary key is
Emp_Id)
Candidate Key: Emp_Id, Aadhar_no and Mobile no
3. Write command to create table EMP with attributes(Empno, Ename,
DName, Job, DOJ, Location)
Ans. CREATE TABLE EMP( Empno int primary key, Ename varchar(20),
DName Varchar(15), Job Varchar(15), DOJ date, Location varchar(15));
4. Consider the following tables EMPLOYEE and JOB given below. Write
SQL statements from (i) to (iv)
EMPLOYEE
EID NAME SALES JOBTITLE
E1 SUMIT SINHA 1100000 PRESIDENT
E2 VIJAY SINGH 1300000 VICE PRESIDENT
TOMAR
E3 AJAY RAJPAL 1400000 ADMINISTRATION
ASSISTANT
E4 MOHIT 1250000 ACCOUNTING
MANAGER
E5 SHAILAJA 1450000 ACCOUNTANT
L1 - QUESTIONS
1. What is Artificial Intelligence?
2. What is Machine Learning?
3. Explain NLP.
4. What is VR?
5. Explain AR.
6. Define Robotics.
7. What is Big data?
8. What are sensors?
9. Explain IoT.
10.Write about cloud computing.
11.Explain grid computing.
12.Explain Block chain technology.
L2 – QUESTIONS
1. Differentiate between cloud computing and grid computing with suitable
examples.
2. Explain the use of sensors with example.
3. Five friends plan to try a startup. However, theyhave a limited budget and
limited computer infrastructure. How can they avail the benefits of cloud
services to launch theirstartup?
4. Which is not one of the features of loT devices?
5. Microsoft Office365 is an example of which type of cloud service model?
6. PaaS offerings typically follow a pay-as-you-go pricing model.
L3 - QUESTIONS
1. 'Storage of data is cost effective and time saving in cloud computing.'
Justify the above statement.
2. What is on-demand service? How it is provided in cloud computing?
3. Write examples of the following:
a) Government provided cloud computing platform
b) Large scale private cloud service providers and the services
4. A company interested in cloud computing is looking for a provider who
offers a set of basic services such as virtual server provisioning and on-
demand storage that can be combined into a platform for deploying and
running customised applications. What type of cloud computing model fits
these requirements?
ANSWERS - WORKSHEET ON EMERGING TRENDS
L1 - ANSWERS
1. Artificial Intelligence (AI) basically refers to the ability of a machine or a
computer program to think and learn.
5. AR adds components of the digital world to the physical world, along with
the associated tactile and other sensory requirements.
7. Data sets of enormous volume and complexity are called Big Data.
8. A smart sensor is a device that takes input from the physical environment
and uses built-in computing resources to perform predefined functions
upon detection of specific input and then process data before passing it on.
10. Computer-based services delivered over the Internet or the cloud, which
can be accessed any where using any smart device
2. Sensors are very commonly used for monitoring and observing elements
in real world applications.
Example: What happens when you hold your mobile vertically or
horizontally?
The display also changes to vertical or horizontal with respect to the way
we hold our mobile. This is possible with the help of two sensors, namely
accelerometer and gyroscope (gyro). The accelerometer sensor in the
mobile phones detects the orientation of the phone. The gyroscope sensors
tracks rotation or twist of your hand and add to the information supplied
by the accelerometer.
4. b) Programmable
5. c) Software as a Service
6. a) True
L3 - ANSWERS
1. In cloud computing, the on-demand services are available instantly and one
has to pay only for the service and not for theentire infrastructure. Thus,
when one avails storage on a cloud, they just pay for the storage they used
and not for other infrastructure, hence it is cost-effective. And since cloud
services are readily available, these are time-saving too.
3. a) MeghRaj
4. c) Infrastructure as a Service
Unit 1: Introduction to Computer System
➢ Abacus
➢ Pascaline
➢ Analytical Engine
➢ Tabulating Machine
Evolution of computing ➢ Turing Machine
➢ EDVAC/ENIAC
➢ Transistor
➢ Integrated Circuit
➢ Input device
➢ Output device
Components of computer
➢ Central processing unit
system
➢ Memory unit
➢ Mouse
➢ Keyboard
➢ Joystick
➢ Webcam
➢ Scanner
Input Devices ➢ MICR
➢ OMR
➢ OCR
➢ Monitor
➢ Printer
➢ Speaker
➢ Projector
Output Devices
➢ Plotter
➢ Primary memory
Eg: RAM, ROM
Memory types ➢ Secondary memory
Eg: CD, Hard Disk,
DVD
➢ Operating system
➢ Language processor
System Software ➢ Utility software
➢ Device drivers
IDENTIFIERS
KEYWORDS
TOKENS
LITERALS
OPERATORS
PUNCTUATORS
STRING LITERAL
NUMERICAL LITERAL
LITERALS
BOOLEAN LITERAL
pop(<index>)
remove(<item>)
Removing
clear()
elements
len()
index(<item>)
count(<item>)
Other functions reverse()
sort()
Dictionary
Standard data type
Characteristics Key-Value pairs
Mutable & Unordered
len()
clear()
get(<key>)
Dictionary items()
functions keys()
values()
update(<dict>)
Unit 3: Database concepts and Structured Query
Language
❖ Increases Competency
❖ Time-saving
❖ Security
Need for DBMS ❖ Flow of information
❖ Centralized storing
Advantages of ❖ Reduces Data inconsistency
❖ Reduces data redundancy
DBMS ❖ Sharing of data
Relational Database
RDBMS Management System
Relation Table
Row in a Table
Tuple
Terminologies
Column in a Table
Attribute
Candidate Key
DDL
Data Definition Language
Eg:- CREATE, ALTER, DROP
DML
Data Manipulation Language
Eg:- INSERT, UPDATE, DELETE
DQL
Data Query Language
Eg:- SELECT
❖ INT
❖ FLOAT(M, D)
❖ DECIMAL(M, D)
❖ CHAR(x)
Datatypes in SQL
❖ VARCHAR(x)
❖ DATE
❖ TIME
QUERIES
CREATE DATABASE
DATABASENAME;
Eg:- CREATE DATABASE EMPDB;
Create Database
USE DATABASENAME;
Eg:- USE EMPDB;
Open database
CREATE TABLE
TABLENAME(([column definitions])
[table parameters];
Eg:- CREATE TABLE Employee
(Empid INT PRIMARY KEY,
Create table Firstname CHAR(50), Lastname
CHAR (75) NOT NULL);
QUERIES
Siri or Alexa
AI
EXAMPLES Google’s NEST
MACHINE LEARNING
UNSUPERVISED
REINFORCEMENT
SENTIMENT ANALYSIS
PREDICTIVE TEXT
AUTOMATIC SUMMARIZATION
MACHINE TRANSLATION
VIRTUAL REALITY
IMMERSIVE EXPERIENCES
AUGMENTED REALITY
A DRONE
VOLUME
VELOCITY
VERACITY
VALUE
ACCELEROMETER
SENSORS EXAMPLE
GYROSCOPE
SMART TUNNEL
SMART BRIDGE
INFRASTRUCTURE AS A SERVICE (IAAS)
CLOUD SERVICES
PLATFORM AS A SERVICE (PAAS)
HETEROGENEOUS
DECENTRALISED
BLOCKCHAIN TECHNOLOGY
- DATABASE
SHARED
INTERNET OF THINGS
KENDRIYA VIDYALAYA, CHENNAI REGION
CLASS XI
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each.
8. All programming questions are to be answered using Python Language only.
PART A
1 Which of the following is valid arithmetic operator in Python: 1
(i) // (ii) && (iii) > (iv) and
2 Out of the following, which one is an example for Utility software? 1
a. Operating system
b. Antivirus software
c. compiler
d. MS Word
PART B
19 Distinguish between primary memory and secondary memory? 2
OR
What is the function of input devices? Write any two examples?
OR
25 With the help of suitable table, explain candidate key and alternate 2
key?
PART C
26 Briefly explain computer system with neat diagram 3
OR
What is big data? What are the characteristics of big data?
30 Consider the given list, L=[20,30,40,100]. What will be the output 3
of the following:
i. print(L*2)
ii. print(L[-2])
iii. print(L.pop())
or
Explain the following list functions with example:
i. insert()
ii. remove()
iii. append()
PART D
31 Write output for SQL queries (i) to (v) based on the table: SCHOOL 5
OR
OR
Explain the following terms with an example table:
i. Relation
ii. Tuple
iii. Domain
iv. primary key
v. cardinality
PART E
34 Consider the following table “ACTIVITY” and answer the 1+1+2
following question based on this table?
CLASS XI
ANSWER KEY
PART A
1 (i) // 1
2 Antivirus software 1
3 Manipulation 1
4 Variable name can start with an underscore. 1
5 Python 1
6 b. (2,3,4,2,3,4) 1
7 Alternate Key 1
8 OMR 1
9 False 1
10 Cardinality 1
11 Virtual 1
12 CREATE DATABASE SCHOOL; 1
13 230 bytes 1
14 Select 1
15 Things 1
16 None 1
17 iii 1
18 i 1
PART B
19 Any two correct difference 2
Or
Function of input device( 1 mark), two eg(1 mark)
20 a. OpenOffice-Free and open source 2
b. Adobe Photoshop-Proprietary
c. Skype-Freeware
d. Python- Free and open source
21 p=100.0 2
q=160.0
(1 mark for each correct answer)
22 DDL-, DROP, ALTER 2
DML-INSERT,UPDATE
23 33 15 2
Or
2468
Sum=8
OR
(definition-1 mark, charctersitics with explanation-2 mark)
Data sets of enormous volume and complexity are called Big Data.
Characteristics of Big Data:
o Volume : Enormous size.
o Velocity : Rate at which the data under consideration is being
generated and stored.
o Variety : Data set has varied data, such as structured,
semistructured and unstructured data. Some examples are text,
images,
videos, web pages and so on.
o Veracity : Veracity refers to the trustworthiness of the data. Big
data can be sometimes inconsistent, biased, noisy.
o Value : Big data possess to have hidden patterns and useful
knowledge.
30 a. [20,30,40,100,20,30,40,100] 3
b. 40
c. 100
or
explanation with eg, each carries 1 mark
PART D
31 5
i. SELECT * FROM SCHOOL WHERE
SUBJECT=’ENGLISH’;
OR
i. MySQL, oracle, SQlite, Postgres(any two- 1 mark)
ii. Database facilitates centralized storing, Reduces Data
inconsistency, Reduces data redundancy, Sharing of data is
possible etc (Any two correct points- 1 mark)
iii. Structured Query Language (SQL) is a standard language for
accessing and manipulating databases.(1 mark)
iv. Teachername-char/varchar(1/2 mark)
Experience-int(1/2 mark)
v. WHERE(1 mark)
ii. b./
iii. a. Single line comment
iv. c. float
v. Amount in dollars is:2.0Thank you for using currency converter!
33 5
i. CREATE TABLE ORGANISATION(ECODE
INT,NAMEVARCHAR(10),POST
VARCHAR(20),SGRAD VARCHAR(4),DOJ DATE);
ii. INSERT INTO ORGANISATION VALUES(2006,
“REENA”,”DEPUTY MANAGER”,”D001”,”22-DEC-
2012”);
iii. SELECT POST FROM ORGANISATION;
iv. SELECT NAME,POST FROM ORGANISATION
WHERE SGRADE=’D003’;
v. SELECT SGRADE,POST FROM ORGANISATION;
OR
i. Relation - Tables in Relational Database
ii. Tuples - Records/Rows in a relation
iii. Domain - Set of values taken for an attribute
iv. Primary key - Key attribute that uniquely identifies a tuple
v. Cardinality – No. of Tuples/records in a relation
(explanation with eg table- 1 mark for each)
PART E
34 a. DEGREE=5,CARDINALITY=5(1 mark) 4
b. DEGREE=7, CARDINALITY=5(1 mark)
c. ACODE as PRIMARY KEY, Because it is unique and not
null( 2 mark)
OR
Any two difference with eg(2 mark)
35 a. i. Monday,Tuesday, Wedneday,Thursday( 1 mark) 4
ii.Tuesday(1 mark)
b. D[5]=’Friday’(2 mark)
Or
del D[3](2 mark)
KENDIRYA VIDYALAYA SANGATHAN, CHENNAI REGION
SAMPLE PAPER CLASS XI
INFORMATICS PRACTICES 065
MM:70 TIME: 180 MIN
General Instructions:
PART-A
1 1
An Antivirus software is an example of
i) Application Software
ii) System software
iii) Utility software
iv) None of these
2 1
First time, Integrated Circuits (ICs) are introduced in generation of
computers?
i) First generation
ii) Second generation
iii) Third generation
iv) Fourth generation
3 8 GB=________ bits? 1
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as
ii. Both A and R are true and R is not the correct explanation for A
17 Assertion (A): - Updating value of any element in a tuple will give error. 1
Reasoning (R):- Alter is a DDL command and it deals with the structure of a table.
PART-B
19 Differentiate between RAM and ROM. 2
Or
20 Differentiate between System Software and Application Software. Give examples of each. 2
21 2
Write the corresponding Python assignment statement.
a) Assign 10 to a variable height and 20 to a variable weight.
b) Assign the sum of height and weight to a variable total.
24 2
Explain the role of where clause in MYSQL with the help of an example.
PART-C
28 Write a program to take a list input and find the smallest number from the list. 3
OR
PART-D
31 Write a program to take input as a list and store the characters and their number of 5
occurences in a dictionary as key value pairs and then display the dictionary.
Eg: Input :[ 'a','a','b','b','a','c','c','c','c','c','d','d','d','d','d','e','e','e']
Output: {'a':3,'b':2,'c':5,'d':5,'e':3}
Or
Write a program to Create a dictionary of students to store names and marks obtained in 5
subjects.
32 5
Or
PART- E
34 Consider the following list and answer any four questions from (i) to (iv) 1+1+2
lst1 = [1, 3, 5]
lst2 = [6, 7, 8]
lst3 = [10, 11, 12]
i) Predict the output for the following process
>>> lst1 + lst2 + lst3
ii) What will be the possible result of the replication process of the given list
>>> lst1 * 3
a) [3, 9, 15]
b) [1, 3, 5, 1, 3, 5, 1, 3, 5]
c) [4, 6, 8]
c) None of the Above
or
Predict the output of the following code >>>l1.append(100)
a) [1, 3, 5, 100]
b) [1, 3, 100, 5]
c) [100, 1, 3, 5]
d) None of the Above
35 1+1+2
a)Using SQL statements in MySQL, create the Database Name: Univ also write a
query to open the database Univ.
Answer parts b), c) on the basis of the structure table job.
General Instructions:
PART-A
3 8 GB=________ bits? 1
4 i)11IPCommerce 1
5 iv) ** 1
6 i) L+L 1
ii) L*2
7 ii) List 1
8 ii) () 1
11 iv) Alter 1
12 ii) column 1
13 ii) Update 1
14 i) Primary Key 1
16 iii) Instagram 1
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as
ii. Both A and R are true and R is not the correct explanation for A
17 i 1
18 iv 1
PART-B
Or
21 2
24 2
1 Mark for explanation and 1 Mark for example
PART-C
OR
PART-D
31 L=eval(input("Enter list elements : ")) 1 Mark for correct input 5
d={} ½ mark for empty dictionary
for e in L: 1 Mark for correct outer loop
if e not in d.keys(): 1 Mark for correct outer loop
d[e]=L.count(e) 1 Mark for correct statement
print(d) ½ mark for output
Or
d={}
ch='y'
while ch=='y': #1 Mark for loop
name=input("Enter name of student") #2 Marks for all inputs
m1=int(input("Enter marks in subject 1:"))
m2=int(input("Enter marks in subject 2:"))
m3=int(input("Enter marks in subject 3:"))
m4=int(input("Enter marks in subject 4:"))
m5=int(input("Enter marks in subject 5:"))
d[name]=[m1,m2,m3,m4,m5] #1 Mark for adding element to
dictionary
ch=input("Add more...?? (y/n") #1 Mark for statement
print(d)
33 5
Or
34 1+1+2
i) [1,3,5,6,7,8,10,11,12]
ii) b) [1, 3, 5, 1, 3, 5, 1, 3, 5]
iii) b) 9
or
a) [1, 3, 5, 100]
35 1+1+2
a) create database Univ.
Use univ
b) Create table Job (Job_Id int(4), Job_des varchar(30), Alloc_on date, Due_on date, Emp_id
int(4));
c) primary key- Job_id and there is no alternate key.
or
show databases and show tables.
KENDRIYA VIDYALAYA SANGATHAN CHENNAI REGION
CLASS : XI
______________________________________________________________________________
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is
given in Q35 against part c only.
8. All programming questions are to be answered using Python Language only.
Section A [18 x 1= 18]
Q Question Mark
No s
.
a) 4 b) 5 c) 1 d) 20
Section B [7 x 2= 14]
19 Briefly explain system software and application software with 2
examples.
OR
Briefly explain the components of computer system using block
diagram.
20 Write the difference between compiler and interpreter. 2
x=2
y=5
z =x + 2**3
x = y *2
y=x+z
print (“Python Program”)
print (“Value of x : ”, x)
print (“Value of y : ”, y)
print (“Value of z : ”, z)
22 What will be the output of the following statements? 2
i) list1 = [12,32,65,26,80,10]
list1.sort()
print(list1)
ii) myList = [1,2,3,4,5,6,7,8,9,10]
del myList[:5]
print(myList)
23 Consider the table STUDENT and answer the following: 2
1 Anitha 11C 58
2 Neha 11C 65
3 Sanjay 11D 89
OR
Predict output:
Section C [5 x 3= 15]
OR
OR
Section D [3 x 5= 15]
OR
The record of a student (Name, Roll No., Marks in five subjects and
percentage of marks) is stored in the following list:
i) Relation
ii) Tuple
iii) Domain
iv) Attribute
v) Primary key
OR
Predict Output:
Section E [2 x 4= 8]
Get the input from user (e.g., calculate EMI for loan amount of 200000
at 10% p.a. rate of interest) for a period of 2 years i.e., 24 months.
OR
Write a Python program to accept a number from user and prints the
frequency of the number in the list LST . If the number is not in LST ,
it should print “ Not in the list”.
A. Write Query :
i) To display the names of employees whose salary is between
50000 and 70000.
ii) To display the name and salary of employees of sales
department.
B. Predict Output
i) SELECT Ename FROM EMP_TBL WHERE dept=”Sales”;
ii) SELECT salary FROM EMP_TBL WHERE ECode=”103”;
Predict Output:
i) SELECT dept FROM EMP_TBL WHERE EName=”Nina
Sharma”;
ii) SELECT * FROM EMP_TBL WHERE Salary >60000 and
Salary<75000;
KENDRIYA VIDYALAYA SANGATHAN CHENNAI REGION
MARKING SCHEME
______________________________________________________________________________
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is
given in Q35 against part c only.
8. All programming questions are to be answered using Python Language only.
Q Question Mark
No s
.
a) 4 b) 5 c) 1 d) 20
Section B [7 x 2= 14]
19 Briefly explain system software and application software with examples. 2
Ans. System software Example- Operating System
Application software Example- MS Office, MS Paint
OR
Briefly explain the components of computer system using block diagram.
Ans . Input unit, Output unit, CPU- ALU, Control unit, Memory unit
20 Write the difference between compiler and interpreter. 2
Ans. Compiler transforms code written in a high-level programming
language into the machine code, at once, before program runs, whereas
an Interpreter converts each high-level program statement, one by one,
into the machine code, during program run.
Compiled code runs faster while interpreted code runs slower.
Compiler displays all errors after compilation, on the other hand, the
Interpreter displays errors of each line one by one.
Compiler takes an entire program whereas the Interpreter takes a single
line of code.
21 Predict the output of the following code 2
x=2
y=5
z =x + 2**3
x = y *2
y=x+z
print (“Python Program”)
print (“Value of x : ”, x)
print (“Value of y : ”, y)
print (“Value of z : ”, z)
Ans. 10
20
10
22 What will be the output of the following statements? 2
i) list1 = [12,32,65,26,80,10]
list1.sort()
print(list1)
del myList[:5]
print(myList)
1 Anitha 11C 58
2 Neha 11C 65
3 Sanjay 11D 89
OR
Predict output:
Ans. i) Sanjay
ii).
3 Sanjay 11D 89
Ans.
Ans.
a=[]
for i in range(0,5):
elem=int(input("Enter element: "))
a.append(elem)
avg=sum(a)/5
print("Average of elements in the list", avg)
29 Explain two categories of SQL and mention the commands in each. 3
Applications:
1. Gaming
2. Natural Language processing
3. Expert systems
4. Speech Recognition
5. Intelligent robots
Or
Ans. It includes various technologies that enhance our senses and gives
us immersive experience. It includes technologies Virtual Reality (VR)
and Augmented Reality (AR).
Section D [3 x 5= 15]
Ans.
The record of a student (Name, Roll No., Marks in five subjects and
percentage of marks) is stored in the following list:
Ans. a) stRecord[3]
b) stRecord[2][4]
c) max(stRecord[2])
d) stRecord[1]
e) stRecord[0]=”Raghav”
32 Explain the following terms in DBMS with the help of a table. Mention 5
examples of each term based on the table data:
i) Relation
ii) Tuple
iii) Domain
iv) Attribute
v) Primary key
Ans.
Eg:Employee
OR
Predict Output:
Informatics Practices 40
v)
Computer Science 45
Physics 50
Economics 48
Section E [2 x 4= 8]
34 Write a program to calculate EMI as per formula: E=PR(1+R)n /((1+R)n - 4
1)
Get the input from user (e.g., calculate EMI for loan amount of 200000 at
10% p.a. rate of interest for a period of 2 years i.e., 24 months.),
calculate and print the EMI.
OR
Write a Python program to accept a number from user and prints the
frequency of the number in the list LST . If the number is not in LST , it
should print “ Not in the list”.
Ans.
LST=eval(input(“Enter elements”))
elm=int(input(“Enter elemnt:”))
c=0
for I in range(0,len(LST)):
if elm==LST[i]:
c=c+1
if c==0:
print(elm,” Not Found”)
else:
print(c )
35 Consider the table EMP_TBL and answer the following: 4
A. Write Query :
i) Write query to display the names of employees whose salary is
between 50000 and 70000.
B. Predict Output
i) SELECT Ename FROM EMP_TBL WHERE dept=”Sales”;
Ans. GAUTAM GUPTA
KARAN KUMAR
ii) SELECT salary FROM EMP_TBL WHERE ECode=”103”;
Ans. 75000
Predict Output:
i) SELECT dept FROM EMP_TBL WHERE EName=”Nina
Sharma”;
Ans. MARKETING
ii) SELECT * FROM EMP_TBL WHERE Salary >60000 and
Salary<75000;
102 Nina Sharma Marketing 62000
Ans.
105 Asha Yadav HR 72000
KENDRIYA VIDYALAYA SANGATHAN CHENNAI REGION
SAMPLE QUESTION PAPER
CLASS XI INFORMATICS PRACTICES (065)
TIME: 3 HOURS M.M.70
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 01 marks each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35
against part c only.
8. All programming questions are to be answered using Python Language
PART A
1 Arrange the memory in ascending order 1
TB, MB, GB, KB, B
2 What will be the value of the following Python expression? 1
4+3%5
3 Which of the following characters is used to give single- 1
line comments in Python?
a) //
b) #
c) !
d) /*
4 What will be the output of the following Python code? 1
x = [1,4,5,3]
for i in x:
print(i)
>>>[1]]+[3,4]
a) [1,4,3]
b) [[1],[3,4]]
c) [1,3,4]
a) None
b) 1
c) 2
d) Error
a. Table
b. Values
c. Relation
d. field
16 Distributed computing system formed by a network of 1
independent computers is known as___________
computing
a. Cloud
b. Grid
c. AI
d. Smart
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the
correct choice as
i. Both A and R are true and R is the correct explanation for A
ii. Both A and R are true and R is not the correct explanation for A
iii. A is True but R is False
iv. A is false but R is True
17 Assertion: Cloud computing is the internet based 1
computing
Reasoning: It enables uses to be able to provision, monitor
and manage the computing resources
18 Assertion: List is mutable data type 1
Reasoning: We can update the values of list elements like
l[1]=5
PART B
Roll_no Preference
9 Cricket
13 Football
17 Badminton
21 Hockey
24 NULL
NULL Kabaddi
Or
I. What do you mean by operating system
II. Write 2 functions of operating system
Iii. give 2 examples of operating systems
30 Define the following: 3
a. Machine Learning
b. Blockchain technology
c. Internet of Things
Or
Or
Or
SECTION E
Or
Write a python program which
I takes the selling price and cost price from the user
Ii find whether it is profit or loss
Iii if it is profit, display the total profit and if it is loss,
display the total loss
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 01 marks each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35
against part c only.
8. All programming questions are to be answered using Python Language
PART A
1 Arrange the memory in ascending order 1
TB, MB, GB, KB, B
Ans: 7
3 Which of the following characters is used to give single-line 1
comments in Python?
a) //
b) #
c) !
d) /*
Ans: b #
4 What will be the output of the following Python code? 1
x = [1,4,5,3]
for i in x:
print(i)
Ans: 1
4
5
3
5 To add a new element to a list we use which Python 1
command?
a) list1.addEnd(5)
b) list1.addLast(5)
c) list1.append(5)
d) list1.add(5)
Ans: c list1.append(5)
6 What will be the output of the following Python statement? 1
>>>[1]]+[3,4]
a) [1,4,3]
b) [[1],[3,4]]
c) [1,3,4]
Ans: [1,3,4]
7 1. names1 = ['Amir', 'Bala', 'Chales'] 1
2.
3. if 'amir' in names1:
4. print(1)
5. else:
6. print(2)
a) None
b) 1
c) 2
d) Error
Ans: c 2
8 What is the full form of DBMS? 1
a) Data of Binary Management System
b) Database Management System
c) Database Management Service
d) Data Backup Management System
c. Query
d. Relational Schema
Ans: DML
Ans c Id
11 What is true about Unique and primary key? 1
a) Unique can have multiple NULL values but Primary can’t
have.
b) Unique can have single NULL value but Primary can’t
have even single.
c) Both can have duplicate values
d) None of the Mentioned
Ans b
12 1
Rows of a relation are known as the _______.
a. Degree
b. Tuples
c. Entity
Ans b
13 1
Which one of the following is a type of Data Manipulation
Command?
a. Create
b. Alter
c. Delete
Ans c delete
14 A Group of columns serving as a primary key are known as: 1
a. Primary key
b. Candidate key
c. Foreign key
d. None of the above
Ans b candidate key
15 In the query mentioned below which keyword has to be 1
inserted
Insert into employee _______(1002,”kaushik”,2000)
a. Table
b. Values
c. Relation
d. field
Ans b values
16 Distributed computing system formed by a network of 1
independent computers is known as___________ computing
a. Cloud
b. Grid
c. AI
d. Smart
Ans: cloud
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the
correct choice as
i. Both A and R are true and R is the correct explanation for A
ii. Both A and R are true and R is not the correct explanation for A
iii. A is True but R is False
iv. A is false but R is True
Ans: ii
18 Assertion: List is mutable data type 1
Reasoning: We can update the values of list elements like
l[1]=5
Ans i
PART B
½ for
range
½ for
semico
lon
21 Predict the output 1
a. for i in range (10,6,-2): marks
for
print (i* 2) each
Ans: 20 correct
answer
16 r
2 mohini chennai 56
3 zafreen bangalore 98
4 christia rameshwara 70
m
½
marks
for
each
correct
classifi
caion
24 I. What do you mean by volatile memory. Give one example 1
II. What do you mean by compiler and interpretor marks
for
each
correct
answer
25 A school has a rule that each student must participate in 1
a sports activity. So each one should give only one marks
preference for sports activity. Suppose there are five for
students in a class, each having a unique roll number. each
The class representative has prepared a list of sports correct
preferences as shown below. Answer the following answer
Roll_no Preference
9 Cricket
13 Football
17 Badminton
21 Hockey
24 NULL
NULL Kabaddi
Ans:
[0, 1, [3]]
[0, 1, [3, 4]]
[0, 1, 2]
27 Write a python program which takes a list from the user and 1
finds the average of the elements of the list marks
for
input
1
marks
for
adding
1
marks
for
averag
e
28 Based on table STUDENT given here, 1
marks
for
RollNo Name Gender each
correct
1 Abhishek M answer
2 Anamika F
SECTION D
Or
Write the SQL queries to perform the following:
1. Create a table employee with employeeid,
employeename, designation and salary
2. Insert 2 records in the table
3. Select all the records from the table employee
4. Select two columns employeename and designation
from the table employee
5. Select all the details of employee whose employeeid is
1
SECTION E
Or
Write a python program which
I takes the selling price and cost price from the user
Ii find whether it is profit or loss
Iii if it is profit, display the total profit and if it is loss,
display the total loss