12 Information Practices Text Book Preeti Arora

Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

Teacher’s Manual

Informatics Practices with Python


Teacher’s Manual
Book XII

CHAPTER 1: Data Handling Using Pandas


Unsolved Questions
Ans 1. Pandas (PANel DAta) is a Python library that offers powerful and flexible data
structures which make data science or data analysis and manipulation easy and
effective. It provides high-performance, easy-to-use data structures and data analysis
tools.
Ans 2. Pandas provides three data structures:
(i) Series: It is a one-dimensional structure (array) storing elements of same data
types.
(ii) Dataframe: It is a two-dimensional structure storing elements of heterogeneous
data type.
(iii) Panel: It is a three-dimensional way of storing items.
Ans 3. df.iterrows() function is used to iterate over a dataframe horizontally; represents
dataframe row-wise, i.e., record by record.
Ans 4. df.iteritems() function is used to iterate over a dataframe vertically; represents
dataframe column-wise.
Ans 5. CSV (Comma Separated Values) is a simple file format used to store tabular data,
such as a spreadsheet or database. A CSV file stores tabular data (numbers and
text) in plain text. Each line of the file is a data record. Each record consists of
one or more fields, separated by commas.
Ans 6. nrows means number of rows. We can display selective records/rows or selective
lines using nrows option or attribute used with read_csv() method.
For example, df= pandas.read_csv("E:\\Data\\Employee.csv",nrows = 5)
Here, nrows=5 display the first five records from the file.
Ans 7. The steps to create a CSV file are:
(i) Launch Microsoft Excel.
(ii) Type the data in the Excel sheet.
(iii) Save the file with a proper name.
(iv) Type the name of the file and select file type as CSV (Comma delimited)
(*.csv) from the drop-down arrow.
(v) Click the Save button. MS Excel will ask for confirmation to select CSV
format.
(vi) Click on OK.
(vii) It will display a dialog box seeking permission to keep comma as a delimiter
for CSV file.
(viii) Click Yes to save the Excel file in CSV format.
Ans 8. We can iterate over the dataframe by using the two methods:
(i) <DFObject>.iterrows()—It represents dataframe row-wise, record by record.
(ii) <DFObject>.iteritems()—It represents dataframe column-wise.
2 Informatics Practices with Python—Teacher’s Manual

For example,
import pandas as pd
data1 = {'Name': ['Rahul', 'Hiten', 'Yuvan'],
'Age': [30, 18, 21], 'City': ['New York', 'Los Angeles',
      'Chicago']}
df1 = pd.DataFrame(data1)
print("Using iterrows():")
for index, row in df1.iterrows():
print("Index:", index, "Name:", row['Name'], "Age:", row['Age'],
"City:", row['City'])
data2 = {'Name': ['Rahul', 'Hiten', 'Yuvan'], 'Age': [30, 18, 21],
      'City': ['New York', 'Los Angeles', 'Chicago']}
df2 = pd.DataFrame(data2)
print("\nUsing a for loop:")
for column_name in df2:
print("Column Name:",column_name)
for index, value in df2[column_name].items():
print("Index:", index, "Value:", value)
print()
Ans 9. (a) seal.empty- returns True if series object ‘seal’ is empty.
(b) seal.index- returns index of the series, seal.
(c) seal.dtype- returns the data type of series object ‘seal’.
(d) seal.hasnans- returns True if ‘seal’ is having any NaN value.
Ans 10. fillna() method is used to fill all missing (NA/NaN) values.
Its syntax is – DataFrameObject.fillna(value which is to be filled)
For example- df.fillna(0), here 0 replaces NaN values of a dataframe, df.
Ans 11. (a) import pandas as pd
data={'Item_ID':['PC01','LC05','PC03', 'PC06','LC03'],
'ItemName':['Personal Computer','Laptop', 'PersonalComputer',
'Personal Computer', 'Laptop'],
'Manufacturer':['HCL India', 'HP USA','Dell USA','Zenith
USA','Dell USA'], 'Price':[42000,55000,32000,37000,57000]}
dfl=pd.DataFrame(data)
print(dfl)
(b) import pandas as pd
data={'Item_ID':['LC03','PC03','PC06','LC03','PC01'],
'CustomerName':['N Roy','H Singh', 'R Pandey','C Sharma',
'K Agarwal'], 'City':['Delhi','Mumbai', 'Delhi', 'Chennai',
'Bengaluru']}
dfC=pd.DataFrame(data)
print(dfC)
(c) merged_df = pd.merge(dfl, dfC, on='Item_ID')
(d) df_left_join = pd.merge(dfl, dfC, how='left', left_on="Item_
ID", right_on="Item_ID")
(e) df_right_join = pd.merge(dfl, dfC, how='right', left_on="Item_
ID", right_on="Item_ID")
Book-XII 3

(f) df_join = pd.merge(dfl, dfC, how='inner', left_on="Item_


ID",right_on="Item_ID")
OR
df_join=pd.merge(dfl, dfC, on='Item_ID')
(g) df_outer = pd.merge(dfl,dfC, how='outer',left_on="Item_
ID",right_on="Item_ID")
(h) dfN = pd.merge(dfI, dfC, how='outer',left_on="Item_ ID",right_
on="Item_ID")
OR
dfN = pd.merger(dfl, dfC, left_index=True, right_index=True)
(i) df_sorted=dfN.sort_values(by='Price',ascending=False)
(j) df=dfN.sort_values(by=['City','Price'],ascending=
[False,False])
Ans 12. (a) 0 43.0271
1 61.7328
2 26.5421
3 83.6113
dtype: float64
(b) 0 True
1 True
2 True
3 True
dtype: bool
(c) 0 0.430271
1 0.617328
2 0.265421
3 0.836113
dtype: float64
(d) 0 3.430271
1 3.617328
2 3.265421
3 3.836113
dtype: float64
Ans 13. pencils False
notebooks False
scales False
erasers False
dtype: bool
pencils 37
notebooks 46
scales 83
erasers 42
dtype: int64
Ans 14. (a) notebooks 46
scales 83
erasers 42
dtype: int64
4 Informatics Practices with Python—Teacher’s Manual

(b) pencils 37
dtype: int64
(c) pencils 37
notebooks 46
dtype: int64
(d) pencils_12
notebooks 12
scales 83
erasers 42
dtype: int64
(e) Index(['pencils', 'notebooks', 'scales', 'erasers']
dtype='object'
(f) [12 12 83 42]
Ans 15. import pandas as pd
weather_data={'day':['01/01/2018','01/02/2018','01/03/2018',
'01/04/2018','01/05/2018','01/01/2018'],'temperature':
[42,41,43,42,41,40],'windspeed':[6,7,2,4,7,2],
'event':['Sunny','Rain','Sunny','Sunny', 'Rain', 'Sunny']}
df=pd.DataFrame(weather_data)
print(df)
for column in df.columns[0:3]:
print(df[column])
Ans 16. import pandas as pd
weather_data={'day':['01/01/2018','01/02/2018','01/03/2018',
'01/04/2018','01/05/2018','01/01/2018'], 'temperature':
[42,41,43,42,41,40], 'windspeed':[6,7,2,4,7,2],
'event':['Sunny','Rain','Sunny','Sunny', 'Rain', 'Sunny']}
df=pd.DataFrame(weather_data)
print(df)
for index, row in df.iterrows():
print(index,row)
Ans 17. (a) The underlined codes result in error.
s2=pd.Series([101,102,1-2,104)]
print(s2.index)
s2.index=[0.1.2.3,4,5]
s2[5]=220
print(s2)
(i) closing parenthesis ‘)’ does not match opening parenthesis ‘[’.
(ii) The values of index are wrong and Length mismatch: Expected axis has
4 elements, new values have 6 elements and they must be separated by
comma (,) instead of dot (.).
Corrected code is –
import pandas as pd
S2=pd.Series([101,102,112,104])
print(S2.index)
S2.index=[0,1,2,3]
S2[5]=220
print(S2)
Book-XII 5

(b) _TypeError:Series.init__() got multiple values for argument


'index'.
Corrected statement is—S=pd.Series([2,3,4,55], index=range(4))
(c) TypeError:Series.__() got multiple values for argument 'index'.
Corrected statement is—S1=pd.Series([1,2,3,4],index=range(4))
(d) ValueError: Length of values (5) does not match length of index (4).
Corrected statement is—S2=pd.Series([1,2,3,4,5], index=range(5))
Ans 18. Error in statement—print(s[102,103,104])-key of type tuple not found
and not a MultiIndex.
Corrected statements -
print(s[102])
print(s[103])
print(s[104])
Ans 19. Length of passed values is 3, index implies 5 and s1['ab'] as no such
‘ab’ index exists.
The corrected code is –
import pandas as pd
s1=pd.Series([1,15,5,2,3], index=list('ababa'))
print(s1['a'])
Ans 20. (a) import pandas as pd
df=pd.read_csv('Class12.csv', sep="\t")
(b) df ['Total_marks'] = df[['Accounts','Maths','BSt','IP','Eco']].
sum(axis = 1)
(c) df ['average'] = (df ['Total_marks'] / 500) * 100
Ans 21. # Assuming the columns in the CSV file are 'rollno', 'name',
'English', 'Physics', 'CS','Maths'
import pandas as pd
df = pd.read_csv("result.csv")
df['Total_marks'] = df[['English', 'Physics', 'CS', 'Maths']].
sum(axis=1)
df['Percentage'] = (df['Total_marks'] / 400* 100
print(df[['rollno', 'name', 'Percentage']])
Ans 22. The function to_csv() is used to store data from a dataframe into a CSV file.
Ans 23. We can use the columns attribute in read_csv() method to import specific columns
from a csv file.
Its syntax is-
Dataframe object=pandas.read_csv("filename.csv", columns=[])

Ans 24. A CSV is a text file; it can be created and edited using any text editor. Advantages
of CSV format:
• A simple, compact and universal format for data storage.
• A common format for data interchange.
• It can be opened in popular spreadsheet packages like MS Excel, Open Office
Calc, etc.
• Mostly all spreadsheets and databases support import/export to CSV format.
Ans 25. import pandas as pd
6 Informatics Practices with Python—Teacher’s Manual

Ans 26. We will use the names attribute to specify our own column names to read data
from csv file.
Ans 27. header=None attribute ensures that the top/first row’s data is used as data and
not as column headers.
Ans 28. nrows argument is given to read_csv() if we want to read the top 10 rows of
data.
Ans 29. (i) Project.loc[4]=["Mohit",'XII','A',"NumPy"]
Project.at[5,:]=["Ashu",'XII','B',"Python"]
(ii) Project['Grade'] = [ 'A', 'B', 'A', 'B', 'C']
(iii) Project [['Name', 'Section']]
(iv) Project.loc[[101,102]]
(v) Project.insert(2, 'School Name', ['ABC School', 'AMC School',
'BPB School', 'DAVV School', 'SCS School'])
(vi) Project.loc[[1,2]]
(vii) Project.at[3, 'Class'] = ['XI']
Project.at[3, 'Grade'] = [''A'']
(viii) Project = Project.drop(['Project Name', 'Grade'], axis=1)
Ans 30. import pandas as pd
D1 = {'ID':[100,110,120,130],
'State':['Delhi','Mumbai','Chennai','Surat'],
'Cases':[3000,4000,5000,4500]}
df=pd.DataFrame(D1)
print(df)
(a) df['Recovery']=[2300, 3300, 4800, 4300]
(b) df = df.assign(NoOfDeaths=[20,55,70,66])
print(df)
(c) df.loc[len(df.index)]=[140,'Rajasthan',6000, 5400,70]
(d) df.insert(3, "Percentage",[76.6,82.5,96.0,96.0,90.0])
(e) del df['Percentage']
(f) df.pop('NoOfDeaths')
(g) df.iloc[0]=[90,'Uttar Pradesh',8000,6800]
(h) df.drop('State', axis=1, inplace=True)
df.drop('Cases', axis=1, inplace=True)
Ans 31. import pandas as pd
name_grade =
pd.Series(['B','A','B+','C','B'],index=["Jai","Jia","Pooja",
"Mani","Shourya"])
name_marks = pd.Series([80,94,86,78,88],
index=["Jai","Jia","Pooja","Mani","Shourya"])
s1 =pd.concat([name_grade,name_marks],axis=1)
student=pd.DataFrame(s1)
print(student)
(a) print(student.head(3))
(b) print(student.tail(2))
Book-XII 7

Ans 32. D1 = {'Name' : ['Jai','Jia','Sapna','Meeta','Sarita'],


  'Sub1':[80,90,89,87,90], 'Sub2':[87,99,98,79,96],
  'Sub3':[76,75,86,58,77], 'Sub4':[65,46,76,56,77],
  'Sub5':[77,89,69,89,90]}
df=pd.DataFrame(D1)
(a) print(df)
Name Sub1 Sub2 Sub3 Sub4 Sub5
0 Jai 80 87 76 65 77
1 Jia 90 99 75 46 89
2 Sapna 89 98 86 76 69
3 Meeta 87 79 58 56 89
4 Sarita 90 96 77 77 90
(b) print(df.head(5))
print(df.tail(3))
Name Sub1 Sub2 Sub3 Sub4 Sub5
0 Jai 80 87 76 65 77
1 Jia 90 99 75 46 89
2 Sapna 89 98 86 76 69
3 Meeta 87 79 58 56 89
4 Sarita 90 96 77 77 90
Name Sub1 Sub2 Sub3 Sub4 Sub5
2 Sapna 89 98 86 76 69
3 Meeta 87 79 58 56 89
4 Sarita 90 96 77 77 90
Ans 33. import pandas as pd
D1 = {'Name' : ['Jai','Jia','Sapna','Meeta','Sarita'],
'Salary':[20000,30000,35000,40000,45000]}
D2 = {'Name' : ['Neha','Priya','Kush','Dia','Parul'],
'Salary':[40000,60000,70000,55000,45000]}
df=pd.DataFrame(D1)
df2=pd.DataFrame(D2)
(a) print(df)
print (df2)
Name Salary
0 Jai 20000
1 Jia 30000
2 Sapna 35000
3 Meeta 40000
4 Sarita 45000
Name Salary
0 Neha 40000
1 Priya 60000
2 Kush 70000
3 Diya 55000
4 Parul 45000
8 Informatics Practices with Python—Teacher’s Manual

(b) df['Salary']=df['Salary']+5000
df2['Salary']=df2['Salary']+5000
print(df)
print(df2)
Name Salary
0 Jai 25000
1 Jia 35000
2 Sapna 40000
3 Meeta 45000
4 Sarita 50000
Name Salary
0 Neha 45000
1 Priya 65000
2 Kush 75000
3 Diya 60000
4 Parul 50000
Ans 34. (a) import pandas as pd
import numpy as np
data=[[10,11,12,13,14],[23,34,45,32,65],[55,60,65,70,75]]
df=pd.DataFrame(data)
print(df)
0 1 2 3 4
0 10 11 12 13 14
1 23 34 45 32 65
2 55 60 65 70 75
(b) df.loc[3]=[1,2,3,4,5]
print(df)
0 1 2 3 4
0 10 11 12 13 14
1 23 34 45 32 65
2 55 60 65 70 75
3 1 2 3 4 5

Ans 35. (a) import pandas as pd


import numpy as np
data=[[23,25,np.NaN, np.NaN],[34,np.NaN,np.NaN,np.NaN],
[43,44,45,46]]
df=pd.DataFrame(data)
print(df)
0 1 2 3
0 23 25.0 NaN NaN
1 34 NaN NaN NaN
2 43 44.0 45.0 46.0
(b) df.fillna(0)
print(df)
0 1 2 3
0 23 25.0 0.0 0.0
1 34 0.0 0.0 0.0
2 43 44.0 45.0 46.0
Book-XII 9

(c) df.fillna({0:-1,1:-2,2:-3,3:-4})
print(df)
(d) df.fillna(method='ffill', inplace=True)
print(df)
0 1 2 3
0 23 25.0 NaN NaN
1 34 25.0 NaN NaN
2 43 44.0 45.0 46.0

Ans 36. import pandas as pd


D1 = {'Rollno' : [1001, 1004, 1005, 1008, 1009],
'Name':['Sarika','Abhay','Mohit','Ruby','Govind']}
D2 = {'Rollno' : [1002, 1003, 1004, 1005, 1006],
'Name':['Seema','Jia','Shweta', 'Sonia', 'Nishant']}
df=pd.DataFrame(D1)
df2=pd.DataFrame(D2)
(a) df3=pd.concat([df,df2], axis=0)
print(df3)
(b) df4=pd.concat([df,df2], axis=1)
print(df4)
Ans 37. import pandas as pd
data={'A':[]}
df=pd.DataFrame(data,columns=['A'])
print(df)
print(df.empty)
True
Ans 38. import pandas as pd
data={'A' : [5,6], 'B': [3,0], 'C': [0, 0]}
df=pd.DataFrame(data,columns=['A','B','C'])
print(df)
print(df.all())
A B C
0 5 3 0
1 6 0 0
A True
B False
C False
dtype:bool
print(df.any())
A True
B True
C False
dtype:bool
Ans 39. import pandas as pd
data={'A' : [True, True], 'B': [True, False], 'C': [False, False]}
df=pd.DataFrame(data,columns=['A', 'B', 'C'])
print(df.all())
10 Informatics Practices with Python—Teacher’s Manual


Output:
A True
B False
C False
dtype:bool
print(df.any())

Output:
A True
B True
C False
dtype:bool
Ans 40. inplace=True statement allows you to modify the data in an already existing
object instead of creating a new object. When inplace=True is used, the function
modifies the original object and returns None. Without inplace=True, the function
returns a new DataFrame or Series with the modifications applied, leaving the
original object unchanged.
Ans 41. del statement will simply delete the entire column and its contents from the
dataframe (in-place).
We can delete an element from a series using drop() method by passing the index
of the element to be deleted as the argument to it.
In case of a dataframe, drop() method will delete the values of dataframe.
The values can be of either row or column.
The pop() function will delete the column from a dataframe by providing the
name of the column as an argument. It will return the deleted column along with
its values.
CHAPTER 2: Data Visualization
Unsolved Questions
Ans 1. import matplotlib.pyplot as plt
year=[2018,2019,2020,2021,2022]
population=[135.26, 136.64,138.0,139.34,139.89]
plt.plot(year,population)
plt.title("My Title")
plt.xlabel("Year")
plt.ylabel("Population")
plt.xticks(year)
plt.yticks()
plt.show()


Ans 2. Matplotlib is an open-source 2D plotting library that helps in visualizing figures.
Matplotlib is used in Python as it is a robust, free and easy library for data
visualization. It is easy to learn and understand. Matplotlib library is used for
creating static, animated and interactive 2D-plots or figures in Python.
Ans 3. Pyplot provides an interface to the plotting library in Matplotlib. It means that
figures and axes are implicitly and automatically created to achieve the desired
plot. For example, calling plot() function from pyplot module will automatically
create the necessary figure and axes to achieve the desired plot.
Ans 4. There are many types of visualizations (graphs) that can be plotted using pyplot.
Some of the most famous are: line plot, scatter plot, histogram, box plot, bar chart
and pie chart.
Ans 5. show() function is used to show the graph.
For example plt.show()
Ans 6. Figure: It represents the entire window or page where the plot appears.
A Figure can contain one or more Axes.
We can compare Figure as a canvas where we create and draw plots.
It can include multiple subplots or different types of plots.
12 Informatics Practices with Python—Teacher’s Manual

Axes: The Axes is the area where data is plotted or we can say that it is the

region of the Figure where data is visualized.
Each Axes has an x-axis and a y-axis, and may contain additional elements such
as labels, ticks, legends, etc.
A Figure can have multiple Axes, allowing for multiple plots (subplots) to be
displayed together.
We can interact with the Axes to set properties such as titles, labels, and limits,
and to add plot elements such as lines, points or histograms.
Ans 7. The subplot() function is used to create multiple plots within the same figure,
arranged in a grid-like layout. This function allows us to display different aspects
of the data or multiple datasets side by side for comparison. Each subplot can
have its own axes, allowing for independent customization.
The subplot() function takes three integer parameters:
subplot(nrows, ncols, index)

Ans 8. import matplotlib.pyplot as plt
subject=["English","Maths","Physics","Chemistry","IP"]
marks=[85,87,90,93,97]
plt.plot(subject,marks)
plt.title("Scores")
plt.xlabel("Subject")
plt.ylabel("Marks")
plt.show()


Ans 9. import matplotlib.pyplot as plt
Subject=["English","Hindi","Science","French","Maths"]
Mid_term_Exams= [90,87,84,93,95]
plt.plot(Subject,Mid_term_Exams, color='blue',linewidth=3,
label="Mid Term Exams")
Subject=["English","Hindi","Science","French","Maths"]
End_term_Exams= [95,89,87,96,99]
plt.plot(Subject,End_term_Exams,color='red',
linewidth=5,label="End Term Exams")
plt.title("Marks scored in term exams")
plt.xlabel("Subject")
plt.ylabel("Marks")
plt.legend()
plt.show()
Book-XII 13


Ans 10 import matplotlib.pyplot as plt
x1 = [1, 2, 3, 4, 5]
y1 = [2, 4, 6, 8, 10]
x2 = [1, 2, 3, 4, 5]
y2 = [1, 3, 5, 7, 9]
plt.plot(x1, y1, marker='o', label='Line 1')
plt.plot(x2, y2, marker='s', label='Line 2')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Line Plot with Markers')
plt.xticks(range(1, 6))
plt.legend()
plt.show()


Ans 11. import matplotlib.pyplot as plt
clas = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X']
strength = [40, 43, 45, 47, 49, 38, 50, 37, 43, 39]
col = ['blue', 'orange', 'green', 'red', 'purple',
   'brown', 'pink', 'gray', 'olive', 'cyan']
plt.bar(clas, strength, align='center',color=col)
plt.xlabel('Classes')
plt.ylabel('Number of Students')
plt.title('Number of Students in Each Class')
plt.show()
14 Informatics Practices with Python—Teacher’s Manual


Ans 12. import matplotlib.pyplot as plt
clas = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X']
strength = [40, 43, 45, 47, 49, 38, 50, 37, 43, 39]
col = ['blue', 'orange', 'green', 'red', 'purple',
    'brown', 'pink', 'gray', 'olive', 'cyan']
plt.barh(clas, strength, align='center',color=col)
plt.xlabel('Classes')
plt.ylabel('Number of Students')
plt.title('Number of Students in Each Class')
plt.show()


Ans 13. import matplotlib.pyplot as plt
X = range(-10, 11)
Y_squared = [4 * x for x in X]
plt.plot(X, Y_squared)
plt.xlabel('X')
plt.ylabel('Square of Y')
plt.title('Line Graph: Square of Y = 4*X')
plt.show()
Book-XII 15


Ans 14. import matplotlib.pyplot as plt
X = [i for i in range(-10, 11)]
Y = [x ** 2 for x in X]
plt.plot(X, Y)
plt.xlabel('X')
plt.ylabel('Y = X^2')
plt.title('Plot of y = X^2')
plt.show()


Ans 15. The various methods used with pyplot object are:
• plot(\*args[, scalex, scaley, data])- It creates a plot x versus y as lines and/or
markers.
• bar(x, height[, width, bottom, align, data]) – It creates a bar plot.
• barh(x, height[, width, bottom, align, data]) – It creates a horizontal bar plot.
• hist(x[, bins, range, density, weights, ...]) – It plots a histogram.
Ans 16. (i) show(): This function is used to display the plot.
(ii) legend(): Legends are used to explain different sets of data plotted in
different colors or symbols in the chart.
Ans 17. import numpy as np
import matplotlib.pyplot as plt
num_students = 40
max_marks = 100
marks = np.random.randint(0, max_marks + 1, num_students)
plt.hist(marks, bins=10, range=(0, max_marks), edgecolor='black')
plt.title('Histogram of Class Test Marks')
plt.xlabel('Marks')
plt.ylabel('Frequency')
plt.show()
16 Informatics Practices with Python—Teacher’s Manual


Ans 18. To display the changes in temperature in the last seven days, we should use a
line chart as it will display trends over time.
Ans 19. For this bar plot, first we need to store data—
import pandas as pd
data = {'University': ['Daulat Ram College', 'Mata Sundari Devi',
'Hansraj College'], 'Science Courses': [50, 40, 60], 'Commerce
Courses': [30, 35, 25], 'Humanities Courses': [20, 25, 30]}
df = pd.DataFrame(data)
df.to_csv('university_courses.csv', index=False)
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv('university_courses.csv')
df.plot(kind='bar', x='University', stacked=True)
plt.title('Number of Courses by University')
plt.xlabel('University')
plt.ylabel('Number of Courses')
plt.legend(title='Course Type')
plt.show()
vi

e
ge

eg
e
le

iD

ll
ol

o
ar

jC
mC

nd

ra
Ra

Su

ns
at

ta

Ha


ul

Ma
Da
Book-XII 17

Ans 20. A histogram is a statistical tool used to summarize discrete or continuous data. It
provides a visual interpretation of numerical data by showing the number of data
points that fall within a specified range of values called ‘bins’.
To construct a histogram, first divide the range of values into intervals called bins,
and count how many values fall into each bin. The bins are typically consecutive,
non-overlapping intervals,which may or may not be of equal size. To construct
a histogram, you first divide the range of values into intervals, called bins, and
count how many values fall into each bin. The bins are typically consecutive, non-
overlapping intervals, which may or may not be of equal size.
For example,
df.plot(kind='hist',bins=[11,18,25,25,22])
OR
df.plot(kind='hist',bins=20)

OR
df.plot(kind='hist',bins=range(10,35))

OR
plt.hist(x, bins=15)

Ans 21. The different types of plots that can be created using hist() function are: ‘bar’,
‘barstacked’, ‘step’, ‘stepfilled’.
Ans 22. Histograms and bar charts are both used to visualize data distributions, but they
serve different purposes and are suitable for different types of data. Histograms
are typically used when we have continuous data and we want to visualize the
distribution or frequency of values within a range. Bar charts, on the other hand,
are used when we have categorical or discrete data. They are ideal for comparing
the values of different categories or groups.
Ans 23. (i) import matplotlib.pyplot as plt
weights = [78, 72, 69, 81, 63, 67, 65, 79, 74, 71, 83, 71, 79, 80]
plt.hist(weights, bins=5, color='skyblue', edgecolor='black')
plt.xlabel('Weight (grams)')
plt.ylabel('Frequency')
plt.title('Simple Histogram of Muffin Weights')
plt.show()


(ii) import matplotlib.pyplot as plt
weights=[78,72,69,81,63,67,65,79,74,71,83,71,79,80]
plt.hist(weights,orientation='horizontal',color='skyblue',
edgecolor='black')
plt.xlabel('Frequency')
plt.ylabel('Weight(grams)')
plt.title("Histogram Horizontal of Muffin Weights")
plt.show()
18 Informatics Practices with Python—Teacher’s Manual


(iii) import matplotlib.pyplot as plt
weights=[78,72,69,81,63,67,65,79,74,71,83,71,79,80]
plt.hist(weights,histtype='step', edgecolor='black')
plt.xlabel('Weight(grams)')
plt.ylabel('Frequency')
plt.title("Step-Type Histogram of Muffin")
plt.show()


(iv) import matplotlib.pyplot as plt
weights=[78,72,69,81,63,67,65,79,74,71,83,71,79,80]
plt.hist(weights,cumulative=True color='skyblue')
plt.xlabel('Weight (grams)')
plt.ylabel('Cumulative Frequency')
plt.title('Cumulative Histogram of Muffin Weights')
plt.show()


Book-XII 19

Ans 24. The three Python libraries used for data analysis are:
(i) Pandas – Series(), DataFrame(), read_csv(),etc.
(ii) NumPy – arrays(), mean(), median(),etc.
(iii) Matplotlib- pyplot.plot(), xlabel(), ylabel(),etc.
Ans 25. import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
data = pd.read_csv('filepath')
for region in data['Region'].unique():
   region_data = data[data['Region'] == region]
   plt.scatter(region_data['Population'], region_data['Literacy Rate'],
   s=np.sqrt(region_data['Literacy Rate'])*10, marker='d',label=region)
plt.xlabel('Population')
plt.ylabel('Literacy Rate')
plt.title('Population vs. Literacy Rate by Region')
plt.legend()
plt.show()
avg_literacy_by_region = data.groupby('Region')['Literacy Rate'].mean()
avg_literacy_by_region.plot(kind='bar')
plt.ylabel('Average Literacy Rate')
plt.title('Average Literacy Rate by Region')
plt.show()
CHAPTER 3: Review Of Database Concepts & SQL
Unsolved Questions
Ans 1. Data is termed as the raw facts and figures about something which is not organized.
For example, Namrata, 12.
Ans 2. The processed data is known as information or we can say that information is a
meaningful piece of data.
For example, StuName Class
Namrata 12
Now, it conveys the information that Namrata is a student who reads in class 12.
Ans 3.

DATA INFORMATION
1. It is a collection of raw facts and figures. 1. It is the processed or meaningful piece of data.
2. It is not arranged. 2. It is arranged.
3. It is unorganized. 3. It is organized.
4. It does not depend on information. 4. It depends on data.
5. For example, "123456789", "12/31/2023". 5. For example, Name = Shreya, Rollno =16.

Ans 4. A database is defined as an organized collection of information about an entity


that serves many applications. It is the highest unit of file organization.
A database system is a software system that allows users to efficiently organize,
manage, and manipulate large volumes of data. It provides mechanisms for storing,
retrieving, updating and deleting data in a structured and organized manner.
The elements of the database system are as follows:
(a) Data (b) Field
(c) Record (d) Table
(e) Database
Ans 5. We need a database because of the following reasons:
(a) It provides a structured and organized way to store large volumes of data.
(b) It enforces rules and constraints to ensure the accuracy and consistency of
data.
(c) It offers built-in security features to protect sensitive data from unauthorized
access, manipulation, or theft.
(d) It facilitates data sharing and collaboration.
(e) It allows the users to retrieve and analyze data efficiently.
(f) It supports scalability as data grows.
(g) It provides data backup and recovery mechanisms.
Ans 6. A Database Management System (DBMS) is a general-purpose software that
facilitates the process of defining, constructing and manipulating databases for
various applications.
We need a DBMS because of the following reasons:
(a) It eliminates the data redundancy.
(b) It provides data consistency.
(c) It facilitates the sharing of data.
Book-XII 21


(d) It reduces the programming efforts.

(e) It provides data security and privacy.

(f) It provides data backup and recovery mechanisms.

(g) It provides data integrity.

(h) It supports scalability.
Ans 7. (i)
Database File
It is an organized collection of related It is unstructured or semi-structured
data, managed by a DBMS. data stored as a single unit.
It supports complex data relationships It does not support relationships,
and integrity constraints. treated as a single entity.
It provides security, concurrency control, It provides limited security,
scalability, and backup features. scalability, and backup options.
It is efficient for data retrieval, It is efficient for performing basic
manipulation, and analysis. read or write operations.

(ii)
Data File
It is defined as raw facts, figures, or It is a collection of related
observations. information stored together.
It can be text, numbers, dates, etc. It can be text, binary or both.
It can be manipulated, analyzed or It can be read, written, edited and
processed. deleted.
It is often managed within a database or It is managed by file systems or
other data storage systems. database systems.
Ans 8. (i) The most likely key for the primary key is CUST-ID.
(ii) The candidate keys are CUST-ID, CITY, PHONE and the alternate keys
are CITY, PHONE.
Ans 9. (i) Relation: It is a collection of logically related records. It is a combination of
tuples and attributes. We can also say that it is a named collection of data
items which represents a complete unit of information.
(ii) Domain: It defines the kind of data represented by the attribute. It is the
set of all possible values or pool of values that an attribute may contain. For
example, Gender column can have two possible values either ‘M’ or ‘F’.
(iii) Tuple: Each row in a relation is known as a tuple. It can be called as a row
or record. It is also defined as the horizontal subset of a relation.
(iv) Attribute: It is a set of values of a particular type. It is also defined as the
vertical subset of a relation. It is also used to represent a column of a relation.
For example, Student relation has attributes- Rollno, Name, Course, Fees, etc.
(v) Degree: It is defined as the total number of columns or attributes in a
relation. For example, Student relation has 4 columns, so its degree is 4.
(vi) Cardinality: It is defined as the total number of records or tuples in a relation.
For example, Student relation contains 5 records, so its cardinality is 5.
22 Informatics Practices with Python—Teacher’s Manual

Ans 10. The major differences between a relation and a traditional file follows—
Relation (Relational Database) Traditional File
It is organized into relations (tables). It is stored as flat or hierarchical files.
Relations consist of rows and columns. It contains records or data entries.
It supports relationships between It has no inherent relationships between
relations(tables) using keys (primary, files.
foreign).
It enforces data integrity constraints It has limited or no data integrity
(e.g., primary keys, foreign keys). enforcement.
It has querying capabilities using SQL It has limited querying capabilities, often
(Structured Query Language). require custom scripting.
It provides scalability, security, backup It has limited scalability, security, and
or recovery features. backup or recovery options.

Ans 11. A database is a structured collection of data managed by a Database Management


System (DBMS) whereas a table is a fundamental component within a database,
representing a collection of related data organized into rows and columns.
Each table within a database represents a specific type of data entity, such as
employees or students.
Ans 12. A DBMS is a general-purpose software system that facilitates the process of
defining, constructing and manipulating databases for various applications. The
purpose of DBMS software is to allow the user to create, access, modify and control
a database. We can also say that a DBMS is an electronic or computerized record-
keeping system.
For example, MySQL and Oracle.
Ans 13. Data is organized in a table in the form of rows and columns; rows are the
horizontal subset of a table and columns are the vertical subset of a table.
Ans 14. A primary key is an attribute which uniquely identifies each row or record in a
table. A primary key cannot have duplicate or NULL values.
The function of primary key in a table is to uniquely identify a record and prevent
duplicacy of data. Therefore, it helps in finding data quickly and facilitates in
establishing relationship among tables.
Ans 15. (a) Select * from Product where prod_id>100;
(b) Select * from Product where prod_name='Almirah';
(c) Select * from Product where price between 200 and 500;
(d) Select prod_name from Product where quantity is NULL;
(e) Select * from Product;
Ans 16. (a) Database–A database is defined as an organized collection of information
about an entity that serves many applications. It is the highest unit of file
organization.
(b) Data inconsistency–It refers to a condition in which the same piece of data
is stored differently in two or more locations within a system or database. It
leads to confusion, errors in decision-making, and difficulties in ensuring data
accuracy and reliability.
(c) Primary Key–A primary key is an attribute which uniquely identifies each
row or record in a table. A primary key cannot have duplicate or NULL values.
Book-XII 23

(d) Candidate Key–An attribute or a set of attributes of a table which possesses



the capabilities of becoming a primary key is called as candidate key.
(e) Alternate Key–The candidate key which is not selected as a primary key of

the table is known as an alternate key.
Ans 17. ALTER–Change the name of a column
UPDATE–Update existing information in a table

DELETE–Delete an existing row from a table

INSERT INTO–Insert the values in a table

CONSTRAINTS–Restrictions on columns

DESCRIBE–Table definition

CREATE–Create a database

Ans 18. (a) Select * from Products where stock >110;
(b) Select company from Products where warranty >2;
(c) Select price+stock as 'stock_value' from Products where company
= 'BPL';
(d) Select pname from Products;
(e) Select * from products where pname like "%Y" or "%O" ;
Ans 19. DDL stands for Data Definition Language. DDL commands allow us to perform
tasks related to data definition, i.e., related to the structure of the database objects
(relations/databases).
Examples of DDL commands are Create, Alter, Drop, etc.
DML stands for Data Manipulation Language. DML commands are used to
manipulate data, i.e., records or rows in a table or relation.
Examples of DML commands are Insert into, Update, Delete, etc.
Ans 20.
Primary Key Candidate Key
A primary key is an attribute that A candidate key is an attribute or set of
uniquely identifies each tuple (row) in attributes which possess the capabilities
the relation. of becoming a primary key.
Every relation must have a primary key, A relation may have multiple candidate
and it cannot contain duplicate and null keys, and one of them is chosen to be the
values. primary key.
Example: In a table Student, the Example: In the same table Student,
StudentID column could serve as the StudentID, the combination of FirstName
primary key. and LastName could be a candidate key,
as each combination uniquely identifies
a student.
Ans 21. Degree of a relation in relational database is defined as the total number of columns
or attributes in a relation whereas cardinality of a relation in relational database
is defined as the total number of records or tuples in a relation.
For example, Student relation has 6 rows and 5 columns, so its degree is 5 and
cardinality is 6.
24 Informatics Practices with Python—Teacher’s Manual

Ans 22.
DDL Commands DML Commands
DDL stands for Data Definition DML stands for Data Manipulation
Language. Language.
These commands allow us to perform These commands are used to manipulate
tasks related to data definition, i.e., related data, i.e., records or rows in a table or
to the structure of the database objects. relation.
DDL is not further classified. DML is further classified into two types
such as – Procedural DMLs and Non-
Procedural DMLs.
For example – Create, Alter, Drop, etc. For example, Insert into, Update, Delete,
etc.
Ans 23. (a) Select * from SchoolBus where capacity >70;
(b) Select area_covered from SchoolBus where distance>20 and
charges<4000;
(c) Select * from SchoolBus where Noofstudents <50;
(d) Select rtno, area_covered, charges/Noofstudents as "Average_
Cost" from SchoolBus;
(e) Insert into SchoolBus values(11,"Motibagh",35,32,10,"Kisan
Tours",3500);
Ans 24. (a) Select * from furniture where price >10000;
(b) Select item, price from furniture where discount between 10
and 20;
(c) Delete from furniture where discount = 30;
(d) Select price from furniture where type="Babycot";
(e)
Distinct Type
DoubleBed
BabyCot
OfficeTable
Ans 25. (a) Select name from graduate where rank = 1;
(b) Select name from graduate where average > 65;
(c) Select name from graduate where subject="Computer" and average>60;
(d) Select name from graduate where name like "%a";
(e)
SNO NAME STIPEND SUBJECT AVERAGE RANK
1 KARAN 400 PHYSICS 68 1
2 GAURAV 500 PHYSICS 70 1
3 PUJA 500 PHYSICS 62 1

(f)
DISTINCT RANK
1
2
Book-XII 25

Ans 26. (a) An attribute or a set of attributes of a table which possesses the capabilities of
becoming a primary key is called as candidate key whereas the candidate key
which is not selected as a primary key of the table is known as an alternate
key.
(b) A table having 10 rows and 5 columns, its degree is 5 and cardinality is 10.
(c) (i) Create table STUDENT
(ROLLNO integer(4) Primary Key,
SNAME Varchar(25) Not Null,
GENDER Char(1) Not Null,
DOB Date Not Null,
FEES Integer(4) Not Null,
HOBBY Varchar(15) Null);
(ii) Alter table Student modify sname varchar(30);
(iii) Alter table Student Drop Hobby;
(iv) Insert into Student values (1,"Sahib","M","2014-12-13",
5500,"Drawing");
Ans 27. (i) Select ProductName, Price from Product where Price between 50
and 150;
(ii) Select * from Product where Manufacturer = 'XYZ' or Manufacturer
= 'ABC';
OR
Select * from Product where Manufacturer IN('XYZ', 'ABC');

(iii) Select ProductName, Manufacturer, Price from Product where
Discount IS NULL;
(iv) Select ProductName, Price from Products;
(v) P_ID Column is used as foreign key and CLIENT is the table where it has
been used as foreign key.
Ans 28. (i) Select name from hospital where Dateofadm>"1998-01-15";
(ii) Select name from hospital where Sex='F' and Dapartment='ENT';
(iii) Select name ,Dateofadm from hospital;
(iv) Select name,charges,age from hospital where Sex='F';
CHAPTER 4: Database Query Using SQL
Unsolved Questions
Ans 1. Single Row Functions: Single row functions operate on a single row to return
a single value per row as the output. They can accept one or more arguments but
return only one result per row. These are also known as Scalar functions. When
applied to a table, they return a single result for every row of the queried table.
Multiple Row Functions: These functions are termed as Aggregate Functions

because they summarize the results of a query and return a single value calculated
from all the values present in a column instead of providing the listing of all the
rows. Aggregate functions are also termed as Group Functions and are so called
because they operate on a group or aggregate of tuples (records).
Ans 2. The GROUP BY clause can be used in a SELECT statement to collect data across
multiple records and group the results by one or more columns. It groups the rows
on the basis of the values present in one of the columns and then the aggregate
functions are applied on any column of these groups to obtain the result of the query.
Ans 3. WHERE clause works with respect to the whole table but HAVING clause works
on Group only. If WHERE and HAVING both are used, then WHERE will be
executed first. WHERE is used to put a condition on an individual row of a table
whereas HAVING is used to put a condition on an individual group formed by
GROUP BY clause in a SELECT statement.
Ans 4. SELECT SUM(Marks), AVG(Marks), MIN(Marks), MAX(Marks) From
Student;
Ans 5. SELECT STREAM, SUM(Marks), AVG(Marks), MIN(Marks), MAX(Marks)
From Student Group By Stream;
Ans 6. (a)
SUM(Price)
370
(b)
AVG(Price)
74
(c)
MIN(Price)
150
(d)
MAX(Price)
150
(e)
COUNT(Price)
5

(f)
DISTINCT PRICE
50
100
150
20
Book-XII 27


(g)
COUNT (DISTINCT Price)
4

(h)
Iname Price*Quantity
Soap 5000
Powder 5000
Facecream 3750
Pen 10000
Soapbox 2000
Ans 7. A Function can be defined as a predefined set of commands that helps in performing
certain operations to obtain either a single value or a result set.
SQL provides a large collection of in-built functions, also called library functions,
that can be used directly with SQL statements for performing calculations on data.
Ans 8. SELECT SYSDATE();
Ans 9. SELECT MONTHNAME(CURDATE());
Ans 10. SELECT DAYOFWEEK('1999-07-22');
Ans 11. SYSDATE() returns the time at which the function executes whereas NOW() returns
a constant time that indicates the time at which the statement began to execute.
Ans 12. Select YEAR(J_Date()) – YEAR(B_Date()) As 'Age' From Employee;
Ans 13. Select Stream, Count(*) From Student Group By Stream;
Ans 14. (a) Select * from Faculty where Salary > 12000;
(b) Select * from Faculty where Salary between 8000 and 12000;
(c) Select count(distinct F_ID) from Faculty;
(d) Select count(*) from Faculty where Salary = 10000;
(e) Select * from Faculty where F_Name like "S%";
(f) Select * from Faculty order by Hire_date DESC;
(g) Select MAX(Salary), Min (Salary) from Faculty;

(h)
CONCAT(F_Name, L_Name)
AmitMishra
NitinVyas
RakshitSoni
RashmiMalhotra
SulekhaSrivastava

(i)
Month(Hire_date)
10
12
5
9
6
28 Informatics Practices with Python—Teacher’s Manual

Ans 15. (a) Select Min(Sal), Max(Sal), Avg (Sal) from EMP where Designation =
"MANAGER";
(b) Select Count ( * ) from EMP where Designation = "CLERK”";
(c) Select Designation, EmpName, Sal, DOJ, from EMP Group by
Designation ;
(d) Select Count( * ) from EMP Where Comm IS Null ;
(e) Select DeptID, Avg( Sal ) from EMP Group by DeptID having Count(*)
>5;
(f) Select DeptID, Count(*) from EMP Group by DeptID ;
(g) Select DeptID,Max( Sal ) from EMP Group by DeptID ;
(h) Select EmpName , Designation , DeptName from EMP e, DEPT d where
e.DeptID = d.DeptID;
(i) Select Count(*) from DEPT Where DeptName='Accounts' ;
Ans 16. Create table PAYMENT
(
Loan_number integer(4) Primary Key,
Payment_number Varchar(3),
Payment_date Date,
Payment_amount integer(8) Not Null);
)
Ans 17. (a) Select * from PRODUCT where Price Between 40 and 120;
(b) Update PRODUCT set Price = Price+20;
Ans 18. (a) Select Name from RESULT where Division = "FIRST" Order by Name;
(b) Select Name, Subject , Stipend * 12 as "Annual_Stipend" from
RESULT;
(c) Select Count(*) from Result where Subject = "Accounts" or Subject
= "Informatics";
OR
Select Count(*) from Result where Subject IN ("Accounts",
"Informatics");
(d) Insert into Result Values (7, "Mohan", 500, "English", 73,
"Second");

(e)
AVG(STIPEND)
47.5

(f)
COUNT(DISTINCT Subject)
6

(g)
MIN(AVERAGE)
38
Ans 19. (a) Select * from SchoolBus where Capacity > Noofstudents Order
by Rtno;
Book-XII 29

(b) Select Area_covered from SchoolBus where Distance > 20 and



Charges < 80000 ;
(c) Select Transporter, Sum(NoofStudents) from SchoolBus Group by

Transporter ;
(d) Select Rtno , Area_Covered , Charges / NoofStudents as 'Average'

from SchoolBus ;
(e) Insert into SchoolBus values (11, "Moti Bagh", 35, 32, 10, "Kisan

Tours", 35000) ;

(f) (i)
SUM(Distance)
50
(ii)
Min(NoOfStudents)
40
(iii)
Avg(Charges)
81666.6
(iv)
DISTINCT Transporter
Shivam Travels
Anand Travels
Bhalla Co.
Yadav Co.
Speed Travels
Kisan Tours
Ans 20. (a) Select * From Customers Order by Name ;
(b) Select * From Customers Order by Name Desc ;
(c) Select * from Customers Order by Name, Age Desc ;
(d) Select Max( Salary ) from Customers;
(e) Select Min( Salary ) from Customers ;
(f) Select Count( * ) from Customers ;
(g) Select Avg( Salary ) from Customers ;
(h) Select Sum( Salary ) from Customers;
(i) Select Name from Customers Where Salary > (Select Avg ( Salary )
from Customers );
(j) Select * from Customers where age < (Select Avg ( Age ) from
Customers );
Ans 21. (a) Select * from Worker Order by DOB DESC ;
(b) Select PLEVEL , Count(*) as "NoOfWorkers" from Worker Group by
PLEVEL ;
(c) Select PLEVEL , Count(*) as "NoOfWorkers" from Paylevel where Pay
> 15000 ;
(d) Select Name , Desig from Worker where Plevel IN ("P001", "P002" );
30 Informatics Practices with Python—Teacher’s Manual


(e) (i)
COUNT (PLEVEL) (PLEVEL)
P1 P001
P2 P002
P2 P003
(ii)
MAX (DOB) MIN (DOJ)
1987-07-12 1983-06-09
Ans 22. (a) Primary Key in Event table—EventId
Primary Key in Celebrity table—CelebrityID
Foreign key in Event Table—CelebrityID
The column NumPerformers contains number of performers in each event and
it cannot be set as a primary key because it can have duplicate values and a
primary key always accepts a unique value.
(b) The number of rows will be 4 * 4 = 16 after the Cartesian product.

(c) (i) Select Eventld, Event, CelebritylD from Event where
NumPerformers > 10 ;
(ii) Select CelebrityID, CelebrityName from Celebrity where
CelebrityName like "%khan%" ;
(iii) Select CelebrityName , FeeCharged from Celebrity where
FeeCharged > 200000 ;
Ans 23. (a) Select Name from Student where Stream = "Science" ;
(b) Select Count(*) from Student where Stream = "Commerce " ;
(c) Select Designation, Count(*)from Teacher group by Designation;
(d) Select Max(Pay) from Teacher Where Subject = "English" ;
(e) Select s.Name from Student s ,Teacher t where s.TeacherID =
t.TeacherID and t.Tname = "Anand Mathur" ;
(f) Select t.Tname , t.Designation from Teacher t, Student s where
t.TeacherID = s.TeacherID and s.Name = "Amit";
(g) Select Tname from Teacher where Pay=(Select Max(Pay) from Teacher);
(h) Select City from Teacher where Subject = "Math" ;
(i) Select Tname from Teacher Where Pay= (Select Min(Pay) from
Teacher) And Designation= "PGT" ;
(j) Select s.Name from Student s , Teacher t Where s.TeacherID=
t.TeacherID and t.Designation= "PGT" ;
Ans 24. (a) Select * From Teacher where category= "PGT" ;
(b) Select Name from Teacher where Gender = "F" and Department =
"Hindi";
(c) Select Name, Department, Hiredate from Teacher Order by Hiredate ;
(d) Select Count(*) from Teacher where Department = "English";
(e) Select Department , Hiredate from Teacher where Gender = "F" and
Salary > 25000 ;
(f) Select * from Teacher Where Name Like "J%" ;
(g)
count(*)
1
Book-XII 31


(h)
AVG(Salary)
24500
22500
Ans 25. (a) Select Name from Sports Where Grade1 = 'A' Or Grade2='A';
(b) Select Count(*) from Student Where Game1 = 'Cricket' or Game2 =
'Cricket';
(c) Select Name from Sports Where Game1 = Game2;
(d) Select Game1 , Game2 from Sports Where Name like "A%";
(e) (i)
COUNT(*)
6
(ii)
DISTINCT CLASS
7
8
9
10
(iii)
MAX(Class)
10
(iv)
Game 1 COUNT(*)
Cricket 2
Tennis 2
Swimming 1
Basketball 1
Ans 26. (a) Select * from Item;
(b) Select Iname, Price from Item;
(c) Select * from Item Where Iname='Soap';
(d) Select * from Item Where Iname Like 's%';
(e) Select Itemno, Iname, Price * Quantity as "TotalPrice" From Item;
(f)
DISTINCT PRICE
50
100
150
20
(g)
COUNT(DISTINCT Price)
4
Ans 27. (a)
POW(2,3)
8
32 Informatics Practices with Python—Teacher’s Manual

(b)
ROUND(123.2345,2) ROUND(342.9234,-1)
123.23 340
(c)
LENGTH("Informatics Practices")
21
(d)
YEAR("1979/11/26") MONTH("1979/11/26") MONTHNAME("1979/11/26" DAY("1979/11/26")
1979 11 November 26

(e)
LEFT("INDIA",3) RIGHT("Computer Science",4)
IND ence
(f)
MID("Informatics",3,4) SUBSTR("Practices",3)
form actices
(g)
CONCAT("You Scored",LENGTH("123"),"rank")
You Scored3rank
(h)
ABS(-67.89)
67.89
(i)
SQRT(625) + ROUND(1234.89,-3)
1025
(j)
mod (56,8)
0
CHAPTER 5: Computer Networks
Unsolved Questions
Ans 1. The Internet is a global network of interconnected computer networks, allowing
computers and other devices to communicate and share resources. It is often
referred to as the 'network of networks.' The Internet facilitates the exchange of
information, data, and services across different types of devices and platforms,
connecting people and organizations worldwide. It is also termed as ‘net’.
Ans 2. A network is defined as a collection of interconnected devices, such as computers,
printers, servers, and other peripherals, that are capable of sharing resources and
information. These devices are linked together through wired or wireless connections,
allowing them to communicate with each other and exchange data.
Ans 3. The various types of topologies are:
• Mesh topology
• Bus topology
• Star topology
• Ring topology
• Tree topology
Ans 4. Bus topology: In this topology, a long cable known as backbone is used to connect
all computers with each other. The data is transmitted through a long cable from
the sender to the receiver. Collision can take place when the data is transmitted
from two or more devices at the same time. If there is a break in a cable, no
transmission takes place.
Star topology: In this topology, a central network device such as hub or switch

is required to connect all devices in a network. The data is transmitted from the
sender to the receiver by passing through the hub or switch. No collision takes
place through transmission of data because each device has its own dedicated
connection to the central hub/switch. If the central hub fails, the entire network
shuts down.
Ans 5. (a) Baud: The number of changes in a signal per second is known as baud. It is
the measuring unit of the data transfer rate.
(b) Communication channel: A channel is a communication path through
which the data is transmitted from the sender device to the receiver device. A
communication channel is also known as communication media or transmission
media. Communication media can be wireless(unguided) or wired(guided).
(c) Hubs: It is a multi-port and unintelligent network device that simply transfers
data from one port of the network to another. A hub is a hardware device used
to connect several computers together with different ports. When the packet
reaches one port or one node, it is copied to all the ports connected to hub.
Hub can be either active or passive.
(d) Repeaters: A repeater is an electronic/network device that receives a signal
before it becomes too weak and regenerates the original signal . It is used
to amplify and restore signals for long-distance transmission. Repeaters are
required for cables running longer than 70 metres. It does not change the
functionality of the network.
Ans 6. Modem: A MODEM (Modulator DEModulator) is an electronic device that enables a
computer to transmit data over telephone lines. It is a device used to convert digital
signals into analog signals and vice versa. There are two types of modems, namely
internal modem and external modem.
34 Informatics Practices with Python—Teacher’s Manual

The functioning of internal and external modem:


1. Internal Modem: An internal modem is placed inside a computer. It usually
comes pre-installed in the computer. The best thing about internal modem is that
it operates with the computer’s power supply and does not need an additional
supply to work.
2. External Modem: An external modem is quite similar to an internal modem
where it also allows access to the internet. The external modem is an external
part of the computer. It can be used when a computer is unable to fit an internal
modem inside it. The modem typically connects to the computer via a serial or
USB cable, and it also needs an external power supply to operate.
Ans 7. (a) PPP: Point-to-Point Protocol is used to establish a direct connection between
two nodes.It is used to connect telephone dial-up lines to the internet. It can
provide connection authentication, transmission, encryption and compression
and error detection as well.
(b) POP3: Post Office Protocol is a simple and standard method to access the
mailbox and download messages to the local computers. This protocol manages
authentication of mails and also blocks inboxes during its access which means
that simultaneous access to the same inbox by two users is impossible.
(c) VoIP: Voice Over Internet Protocol is used for transferring voice over internet.
It uses packet switching technology where each packet follows the best route
to reach its destination. It allows both voice and data communications to be
run over a single network due to which infrastructure costs get reduced.
(d) IRC: Internet Relay Chat allows users to chat by sending and receiving text
messages. It uses client server model. The sender sends request to IRC server,
which then forwards this request to another client to communicate with each other
Ans 8. (a) Hubs: It is a multi-port and unintelligent network device that simply transfers
data from one port of the network to another. A hub is a hardware device used
to connect several computers together with different ports. When the packet
reaches one port or one node, it is copied to all the nodes connected to hub.
Hub can be either active or passive.
(b) Repeaters: A repeater is an electronic/network device that receives a signal before
it becomes too weak and regenerates the original signal. It is used to amplify and
restore signals for long-distance transmission. Repeaters are required for cables
running longer than 70 metres. It does not change the functionality of the network.
(c) Routers: A router is a networking device that forwards data packets from the
source machine to the destination machine over a network by using the shortest
path. A router uses IP address to connect a local area network to the internet.
Routers are network devices that can handle different protocols within a network.
A bridge is a device that links two segments of the original network together.
Bridges connect two separate network segments that use the same protocol.
(d) Bridges: A bridge is a device that links two segments of the original network
together. Bridges connect two separate network segments that use the same
protocols.
Book-XII 35

The bridge not only regenerates the signal but also checks the physical address
of the destination and forwards the new copy only to that port. An important
advantage of using a bridge is that it is a smarter hub as it can filter network
traffic on the basis of the MAC addresses.
(e) Gateways: A gateway is a device that connects dissimilar networks. Gateway
provides the necessary translation of data received from the network into a
format or protocol recognized by devices within the internal network. A gateway
is a device that establishes an intelligent connection between a local area
network and external networks with completely different structures.
Ans 9. (a) MODEM (b) Repeaters
Ans 10. (a)
MAN WAN
Covers a larger geographic area, Spans over a vast geographic area,
usually spanning a city or a town. potentially covering multiple cities,
countries, or continents.
Typically owned and operated by a Often consists of multiple
single entity such as a corporation, interconnected networks owned and
university, or government organization. operated by different organizations or
service providers.
Provides high-speed connectivity Offers connectivity over long
within a specific metropolitan area. distances, often utilizing various
telecommunication technologies.
It links resources and users within a It enables communication and data
confined geographic region, like a city transfer over vast distances, linking
or town. resources and users across various
geographical locations.
Examples include Local Area Networks Examples include the internet,
(LANs) within a city, connecting connecting users and resources globally,
different offices of a corporation. regardless of geographical location.

(b)
Website Web Page
It is a collection of related web pages. It is a single document within a website.
It contains multiple webpages, It represents a single HTML document
each offering different content or that displays content on a browser.
functionality.
It has its own domain name and is It is accessed through the website’s
accessible through a specific URL. URL or through hyperlinks on other
webpages.
It consists of various types of content It contains specific information or
such as text, images, videos, and content on a particular topic or purpose.
interactive elements.
It can be dynamic, with content It is static, with content remaining
changing based on user interactions or unchanged unless manually edited or
updates. updated.
Examples include www.example.com, Examples include www.example.com/
www.wikipedia.org, www.amazon.com about-us, www.wikipedia.org/wiki/
History_of_the_Internet, www.amazon.
com/product-page
It is hosted on web servers and It is accessed through web browsers on
accessible globally through the internet. devices connected to the internet.
36 Informatics Practices with Python—Teacher’s Manual

(c)
Router Gateway
A networking device that forwards A device that acts as an entry and exit
data packets between computer point for a network, connecting two
networks. different networks.
Its primary function is to determine Its primary function is to translate
the best path for data packets to reach between different network protocols
their destination. and manage communication between
networks.
It directs traffic based on IP addresses It performs protocol conversion
and routes data to its destination between different network
network. architectures or transmission formats.
It manages multiple network It translates between different
interfaces and makes decisions about communication protocols, allowing
where to send data packets. different types of networks to
communicate.
It can be used within a single network It is typically used to connect a local
or between multiple networks. network to the internet or another
external network.
Examples include home routers, Examples include routers with
enterprise routers, and internet integrated firewall functionality, VPN
backbone routers. gateways, and proxy servers.
(d)
Bus topology Star topology
A long cable known as backbone is A central network device such as hub
used to connect all computers with or switch is required to connect all
each other in a network. devices in a network.
The data is transmitted through a long
The data is transmitted from the
cable from the sender to the receiver.
sender to the receiver by passing
through the hub or switch.
Collision can take place when the No collision takes place through
data is transmitted from two or more transmission of data because
devices at the same time. each device has its own dedicated
connection to the central hub/switch.
If there is a break in a cable, no If the central hub fails, the entire
transmission takes place. network shuts down.
(e)
Static Web Page Dynamic Web Page
It contains fixed content that remains Its content is generated dynamically,
unchanged until manually updated. often in response to user input or
database queries.
It displays the same information to all It can personalize content based on
users regardless of their interactions. user preferences, session data, or
previous interactions.
It is faster to load as the content is pre- It may load slower due to content being
generated and cached. generated on-demand.
It is suitable for websites with It is ideal for websites requiring frequent
relatively static content that rarely updates or user interaction, such as
changes. social media platforms or online stores.
Examples include simple informational Examples include social media feeds,
websites, online brochures, or personal e-commerce websites with product
blogs listings, and web applications with
interactive features.
Book-XII 37

Ans 11. (a) Bus topology


(b) Star topology
Ans 12. World Wide Web: WWW stands for World Wide Web, is an information service
that can be used for sending and receiving information over the internet through
interlinked hypertext documents. The World Wide Web is based upon client-server
architecture where a client sends a request and the server processes that request
and sends responses. A WWW client is called a web browser and a WWW server
is called a web server.
Internet: The Internet is a global network of interconnected computer networks,
allowing computers and other devices to communicate and share resources. It is
often referred to as the 'network of networks.' The Internet facilitates the exchange
of information, data, and services across different types of devices and platforms,
connecting people and organizations worldwide. It is also termed as ‘net’.
Ans 13. Mani can use e-mail service to accomplish his task, i.e., sending his report to the
mentor, through the internet.
Ans 14. Ram can use Google Ads, email marketing and social media platforms like Facebook,
Instagram, etc., for advertising his handicrafts work.
Ans 15. Wi-Fi cards are known as Wireless Fidelity cards as they allow the user to set
up a connection without any wire. A Wi-Fi card such as PCI-Express is used in
a desktop computer that enables a user to establish an internet connection.
A Wi-Fi card is either an internal or external Local Area Network adapter with
a built-in wireless radio and antenna.
Ans 16. HTTPs stands for Hyper Text Transfer Protocol Secure. It is a protocol for
securing the communication between two systems, e.g., the browser and the web
server. HTTPs transfers data between the browser and the web server in the
hypertext format, whereas HTTPs transfers data in the encrypted format. Thus,
HTTPs prevents hackers from reading and modifying the data during the transfer
between the browser and the web server. Even if hackers manage to intercept the
communication, they will not be able to use it because the message is encrypted.
Ans 17. Hub is a multi-port and unintelligent network device that simply transfers data
from one port of the network to another. A hub is a hardware device used to
connect several computers together with different ports. When the packet reaches
one port or one node, it is copied to all the nodes connected to hub.
Hubs can be either active or passive.
Active hubs amplify and regenerate
signals, requiring power and being
more expensive, suitable for larger
networks whereas Passive hubs
don’t amplify signals, don’t need
power, are simpler and cheaper,
better for smaller networks.
Ans 18. In a network environment, servers provide various facilities that are essential for
facilitating communication such as—
(i) Resources (software, hardware) sharing
(ii) Database services
(iii) Backup and Recovery
(iv) User Authentication
(v) Web Hosting
Ans 19. Star topology network is easy to expand.
38 Informatics Practices with Python—Teacher’s Manual

Ans 20. Firewall is responsible for filtering the data and Router can handle different protocols.
Ans 21. When two or more than two devices connected to each other forms a network.
A collection of interconnected computers is called a computer network. Two
computers or devices are said to be interconnected if they are capable of sharing
and exchanging information by following a protocol.
Goals of network are—
(i) Resource Sharing (ii) Improved Communication
(iii) Reduced Communication Cost (iv) Reliability of Data
(v) Central Storage of Data
Applications of network are—
(i) Communication (ii) E-commerce and Online Transactions
(iii) Entertainment and Media (iv) Resources sharing and Collaboration
(v) Distributed computing
Ans 22. A switch (switching hub) is a network device which is used to interconnect computers
or devices on a network. It filters and forwards data packets only to one or more
devices for which the packet is intended across a network. It is also a multi-port
device but with some intelligence and so the data packets received from one port
of the network are refreshed and delivered to the other port of the network.
Ans 23. (a) Repeater: A repeater is an electronic/network device that receives a signal
before it becomes too weak and regenerates the original signal . It is used to
amplify and restore signals for long-distance transmission.Repeaters are required
for cables running longer than 70 metres. It does not change the functionality
of the network.
(b) Router: A router is a networking device that forwards data packets from
the source machine to the destination machine over a network by using the
shortest path. A router uses IP address to connect a local area network to
the internet. Routers are network devices that can handle different protocols
within a network.
(c) Bridge: A bridge is a device that links two segments of the original network
together. Bridges connect two separate network segments that use the same
protocols.
The bridge not only regenerates the signal but also checks the physical address
of the destination and forwards the new copy only to that port. An important
advantage of using a bridge is that it is a smarter hub as it can filter network
traffic on the basis of the MAC addresses.
(d) Gateway: A gateway is a device that connects dissimilar networks. Gateway
provides the necessary translation of data received from the network into a
format or protocol recognized by devices within the internal network. A gateway
is a device that establishes an intelligent connection between a local area
network and external networks with completely different structures.
Ans 24. Error 404 indicates that the specified URL was not found and server was unable
to get the requested webpage. It is usually caused when website content has been
removed or migrated to a different URL without the internal links being adjusted
or restore the deleted webpage.
She can use the following methods to fix this problem:
(i) Retry the web page by pressing F5, clicking/tapping the refresh/reload button,
or trying the URL from the address bar again.
(ii) Check for errors in the URL.
(iii) Move up one directory level at a time in the URL until you find something.
(iv) Search for the page from a popular search engine.
Book-XII 39

Ans 25. We would prefer


(i) hubs over repeaters—when the distance is less.
(ii) bridges over hubs—when we have to connect multiple networks.
(iii) switches over other networking devices—when we want to segment into
multiple subnetworks to prevent traffic overloading.
Ans 26. To install the plug-in, we visit the website of the plug-in’s developer and click on
a link that will download the installer onto our system. We can save the installer
to an easy-to-find location such as the Desktop or a specific folder we have created
to organize all our downloads. Once we have downloaded the installer, we can run/
open it and follow the prompts to install the plug-in on our system.
Ans 27. The steps to install add-ons in google chrome web browser are—
(i) Open Google Chrome: Launch the Google Chrome browser on your computer.
(ii) Go to the Chrome Web Store: Click on the three-dot menu icon located at
the top-right corner of the browser window. From the drop down menu, select
‘More tools’ and then click on ‘Extensions.’ Alternatively, we can directly visit
the Chrome Web Store by typing ‘chrome://extensions/’ in the address bar
and pressing Enter.
(iii) Browse or search for an extension: Use the search bar to find specific
extensions or browse through different categories to discover new ones. We
can also explore featured, recommended, or top-rated extensions.
(iv) Select an extension: Click on the extension we want to install to view its
details, description, ratings, and reviews.
(v) Install the extension: Once we have found the extension we want to install,
click on the ‘Add to Chrome’ button located next to the extension’s name. A
confirmation dialog box may appear asking for permission to add the extension.
Click ‘Add extension’ to proceed.
(vi) Wait for the installation: The extension will be downloaded and installed
automatically. We will see a notification confirming that the extension has
been added to Chrome.
(vii) Manage your extensions: After installation, we can manage extensions by
clicking on the puzzle piece icon (Extensions menu) located to the right of
the address bar. From here, we can access the installed extensions, enable/
disable them, configure settings, or remove them as needed.
Ans 28. Cookies are small bits of data stored as text files on a browser. Websites use those
small bits of data to keep track of users and enable user-specific applications.
Cookies are the easiest way to carry information from one session on a website to
another, or between sessions on related websites, without having to burden a server
machine with massive amounts of data storage. Storing data on the server without
using cookies would also be problematic because it would be difficult to retrieve a
particular user’s information without requiring a login on each visit to the website.
Ans 29. An email address is a unique identifier for an email account. It is used to send
and receive email messages over the internet.
Every email address has two main parts—a username and a domain name. The
username comes before ‘@’ and domain name comes after that. In the example
given below, [email protected], "ventureabc" is the username and "gmail.com"
is the domain name.
Ans 30. URL: www.cbse.gov.in/question_paper.html
Domain name: www.cbse.gov.in
CHAPTER 6: Societal Impacts
Unsolved Questions
Ans 1. Cybercrime is defined as a crime in which a computer is the object of the crime
(hacking, phishing, spamming) or is used as a tool to commit an offence (child
pornography, hate crimes). Cyber criminals may use computer technology to access
personal information, business trade secrets or use the internet for exploitative or
malicious purposes.
Ans 2. Cyber ethics is a form of ‘internet etiquette’ or communication etiquette over the
internet. It is a code of good behaviour while working on the internet. We should
be ethical, respectful and responsible while using the internet and should behave
like a good digital citizen. It includes several aspects of the internet such as social
media, email, online chat, web forums, website comments, multiplayer gaming and
other types of online communication.
Ans 3. Illegal downloads from the internet involve violation of copyright laws where users
download material, such as music, movies, and other forms of media, without properly
purchasing the product or doing so without proper permission of copyright holders.
Ans 4. Phishing is an attempt to acquire sensitive information such as usernames, passwords
and credit card details (and sometimes, indirectly, money) by masquerading as a
trustworthy entity in an electronic communication. In other words, phishing is an
unlawful activity where fake websites or emails that look original or authentic
are presented to the user to fraudulently collect sensitive and personal details,
particularly usernames, passwords, banking and credit card details.
Ans 5. Cyber law is a part of the legal system that deals with cyberspace, internet and legal
issues. It covers a broad area, like freedom of expression, access to and utilization of
internet, and online security or online privacy. It is commonly known as the law of
the web. Cyber law plays a very important role in this new approach to technology. It
is important as it is concerned with almost all aspects of activities and transactions
that take place either on the internet or on other communication devices.
Ans 6. Cyber law in India is primarily implemented through various legislative measures
and government agencies such as—
(i) Legislative Framework: The Information Technology (IT) Act, 2000,
is the primary legislation governing cyber activities in India. It provides
legal recognition for electronic documents, digital signatures, and electronic
transactions, while also defining offenses related to cybercrime and specifying
penalties for such offenses.
(ii) Amendments to the IT Act: The Information Technology (Amendment)
Act, 2008, introduced provisions related to data protection, privacy, and
cybersecurity. Subsequent amendments have further refined and expanded
the scope of cyber law in India.
(iii) Law Enforcement Agencies: Various law enforcement agencies, including
the police and specialized cybercrime investigation units, are tasked with
investigating and prosecuting cybercrimes in India.
Ans 7. The Information Technology Act, 2000 (also known as ITA-2000 or the IT Act) is
an Act of the Indian Parliament (No. 21 of 2000) notified on 17 October, 2000.
It is the primary law in India dealing with cybercrime and electronic commerce.
The Government of India’s IT Act, 2000 (also known as IT Act), amended in 2008,
provides guidelines to the user on the processing, storage and transmission of
sensitive information. The Act provides a legal framework for electronic governance
by giving recognition to electronic records and digital signatures. The act outlines
cybercrimes and penalties for them.
Book-XII 41

Ans 8. A major amendment was made in the IT Act in 2008 which came into force in October
2009. It introduced Section 66A which penalized sending of ‘offensive messages’.
It also introduced Section 69, which gave authorities the power of ‘interception
or monitoring or decryption of any information through any computer resource’.
The Amendments also contained penalties for child pornography, cyberterrorism
and voyeurism.
Ans 9. People unknowingly commit cybercrime in different ways:
(i) By illegal downloading :- Illegal downloads from the internet involve violation
of copyright laws where users download material, such as music, movies, and
other forms of media, without properly purchasing the product or doing so
without proper permission of copyright holders.
(ii) By copying others’ content like photos, videos, blogs etc.
Ans 10. Phishing is an unlawful activity where fake websites or emails that look original
or authentic are presented to the user to fraudulently collect sensitive and personal
details, particularly usernames, passwords, banking and credit card details.
The most common phishing method is through email spoofing where a fake or
forged email address is used that the user presumes to be from an authentic source.
So, you might get an email from an address that looks similar to your bank or
educational institution. It often directs the users to enter personal information at
a fake website, the look and feel of which is identical to the legitimate one, the
only difference being the URL of the website in question.
Ans 11. (a) Some online activities which may help to detect that my friend is being cyber
bullied are:
(i) Checking his Social Media accounts like Facebook, Twitter, WhatsApp, etc.,
for any embarrassing photos or videos.
(ii) Checking his mental and emotional behaviour such as he might be feeling
upset, embarrassed, losing interest, physically tired, etc.
(b) The provisions in the IT Act 2000 to tackle such a situation are as follows:
(i) Section 66(D): This section states that, if a person cheats someone by
portraying their image as someone else on the internet or social media,
he/she shall be punished. The imprisonment may be up to 3 years and/or
a fine of Rs. 1 Lakh.
(ii) Section 66(E): Under this Section one can be punished for capturing
someone’s private pictures intentionally and putting it on the internet or
social media without their consent. The imprisonment may last up to 3
years and/or with a fine of Rs. 3 lakhs.
(iii) Section 67: Under this Section one can be punished if they transfer,
circulate, or upload vulgar or improper material on the internet or social
media. The imprisonment may last up to 5 years and/or with a fine of Rs.
10 Lakhs.
Ans 12. (a) Copyrights: They include literary works such as novels, poems, plays, films,
musical works and artistic works such as drawings, paintings, photographs,
sculptures and architectural designs. Copyright is a legal concept, enacted by
most governments, giving the creator of original work exclusive rights to it,
usually for a limited period.
Patents: They are an exclusive right granted for an invention. In other words,
a patent is an exclusive right to a product or a process that generally provides
a new way of doing something, or offers a new technical solution to a problem.
42 Informatics Practices with Python—Teacher’s Manual

(b) Plagiarism: It refers to copying someone else’s work and then passing it off as
one’s own. It is morally wrong because it is an act of stealing. In other words,
it is copying information and not giving the author credit for it. Plagiarism
includes copying someone else’s work, cutting and pasting blocks of text or
any kind of media (audio, video files or movie clips) from electronic sources
without documenting and at the same time publishing it on the web without
the permission of developers/creators.
Copyright infringement: It means pertains to the violation of someone's
intellectual property (IP). It is another term for piracy or the theft of someone’s
original creation, especially if the one who stole recoups the benefits and not
the creator of the material.
(c) Ethical Hacking: It is also known as penetration testing or white hat hacking,
involves the same tools, tricks and techniques that hackers use, but with one
major difference—they do it for general welfare. Ethical hacking is legal.
Non-ethical Hacking: It refers to the use of advanced technology for exploiting
weaknesses and breaching defences in a computer system. In non-ethical
hacking, the hackers use their skills to make profit, gather information, protest,
or challenge authority. Attacks by such hackers can cause massive loss to the
organizations in terms of finances as well as other resources.
(d) Active Footprints: An active digital footprint is created when a user
intentionally shares personal information either through social media platforms
or websites and apps. Examples of active digital footprints are:
(i) Sharing of personal information on Facebook, Instagram, Twitter and other
social media platforms.
(ii) Working online, such as signing up while logging on to mail accounts to
send or receive emails or text messages.
Passive Footprints: A passive digital footprint is created when information
is collected from a user without their knowledge. Examples of passive digital
footprints are:
(i) Websites that install cookies in a user’s device without their permission.
(ii) Apps and websites that use geo-location to detect a user’s location.
(e) Free Software: Free software means that the users have the freedom to run,
copy, distribute, study, change and improve the software. Thus, ‘free software’
is a matter of liberty, not price. The users may have paid money to get copies
of a free program or obtain copies at no charge.
Free and Open Source Software: Free and open-source software (FOSS)
allows users and programmers to edit, modify or reuse the software's source
code. This gives developers the opportunity to improve program functionality
by modifying it.
Ans 13. The pictures with Creative Commons licenses can be used to create a project
without violating copyrights.
Ans 14. Securing the wireless router is important because anybody within the area of
Wi-Fi signal can connect to it and use it or can also attack your devices and data.
A reasonably strong password consists of at least a lower-case letter, an upper-case
letter, a number and some special characters and must be of atleast 8 characters
in length. We can share our passwords with anyone whom we can trust such as
parents, close friends but we can’t share with our neighbours and home tutors
because they can pose security risks and potentially violate our internet service
provider's terms of service.
Book-XII 43

Ans 15. The precautions that should be taken by people to avoid phishing are:
(i) Always click on trusted website links.
(ii) Install an anti-phishing toolbar that will alert you about a malicious site.
(iii) Never download files from suspicious emails or websites.
(iv) Enable firewalls that will keep track of the activities of your computer and
outside intruders.
(v) Never share your personal or financial details over the internet.
Ans 16. The procedure followed by the police to track cyber crime cases are:
(i) Investigation: For conducting any cybercrime investigation, a certain skill
and scientific tool is required without which the investigation is not possible.
(ii) Process of Search and Arrest: After a complaint is filed, the investigation
cells start with the search and seizure of digital evidences, which is the
intangible data of the virtual world. The main objective of the investigating
officer is to look for a place where the computer or network of computers is
to be found. Advice from technical experts should be referred to whenever
necessary. The investigating officer has to survey the equipment and take
precautionary steps before dismantling the network so that the important
data is not lost.
(iii) The power of the police officer and other officers to enter and search the
investigation is mentioned in the Section 80(1) of the IT Act, which states
that any police officer not below the rank of an Inspector or any other officer
of the Central and State Government authorized by the Central Government
can enter, search and arrest without a warrant, any person who is suspected
to have committed or about to commit the offence under the Act.
Ans 17. The following precautions should be taken so that students do not indulge in
cybercrime unknowingly :
(i) Aware students about the consequences of cyber crime
(ii) Check students’ activities on a daily basis
(iii) Use antivirus and scan computer daily
(iv) Keep computer/system up to date
(v) Do not share sensitive information
(vi) Disconnect from the internet when away
(vii) Be careful with email
(viii) Disable cookies, if possible
Ans 18. Electronic waste, e-Waste or e-Scrap describes the discarded electrical or electronic
devices. ‘Electronic waste’ may also be defined as discarded computers, office
electronic equipment, entertainment device electronics, mobile phones, television
sets and refrigerators. This includes used electronics which are destined for reuse,
resale, salvage, recycling, or disposal. The various methods for effective e-waste
management are as follows:-
(i) Give your Electronic Waste to a Certified E-Waste Recycler.
(ii) Sell off or donate your outdated technology electronic products.
(iii) Give back to your electronic companies or leave at drop-off points.
44 Informatics Practices with Python—Teacher’s Manual

Ans 19.
Proprietary License Open Source License
Owned and controlled by a single entity. Developed collaboratively by a community.
Source code is not freely available. Source code is freely available to view,
modify, and distribute.
Restrictions on usage, modification, and No restrictions on usage, modification,
distribution. and distribution, often governed by
licenses like GPL, MIT, Apache, etc.
Typically involves licensing fees. Generally free to use, may have optional
support or premium versions.
For example,Microsoft Office,Adobe For example, Mozilla Firefox, LINUX
Photoshop,Oracle Database,etc. Kernel, Apache Web Server, etc.
Ans 20. The Internet has turned our existence upside down. It has revolutionized
communications, to the extent that it is now our preferred medium of everyday
communication. We use the Internet for almost every work such as ordering a
pizza, buying anything, sharing a moment with friends, or sending a picture over
instant messaging.
Example of positive aspects of the internet:
• Promote education : The internet has made education more fun and convenient.
Students can now access tons of study materials and video tutorials without
breaking a sweat. People interested in pursuing various careers and e-commerce
are also turning to the internet to apply for jobs, attend online classes, and
make payments remotely.
Example of negative aspects of the internet:
• Cybercrime: The popularity of the internet has also attracted the attention of
bad elements in society. Crimes that take place over and around the internet
are described as cybercrimes. These crimes are often manifested through identity
theft, phishing, fraud, and hacking. With these revelations, the dark web has
become a popular platform to trade stolen data and materials. Other vices
perpetrated over the internet include cyber-bullying, cyber-stalking, internet
predation, child pornography, and spreading hate.
Individual and corporate users also stand a risk of being attacked by computer
viruses and ransomware. All these factors can lead to loss of money, valuable
information, and damage to hardware infrastructure.
Ans 21. The areas where internet addiction is advantageous are:
(i) E-commerce
(ii) Online courses
(iii) Education / Abundant Information
Ans 22. Three emotional symptoms of internet addiction are:
(i) Depression
(ii) Isolation
(iii) Anger issues
Three physical symptoms of internet addiction are:
(i) Impact on bones and joints
(ii) Impact on hearing
(iii) Impact on eyes

You might also like