You are on page 1of 8

Page 1 of 8

CENTRAL EXAMINATION SET: A/01

SAMPLE PAPER (MID TERM 2023)


CLASS: XII
SUBJECT: Informatics Practices
Time allowed: 3 hours Max. Marks: 70

General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 17 questions carrying 01 mark each.
4. Section B has 09 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 04 questions carrying 05 marks each.
7. All programming questions are to be answered using Python Language only.

SECTION A
1. What will be the output of the following code? 1
import pandas as pnd
pnd.Series([1,2],index=['a','b','c'])
a) Syntax Error b) Index Error c) Value Error d)None of the above mentioned
2. What will be the minimum number of arguments required to pass in pandas series? 1
a) 2 b) 3 c) 4 d) None of the above mentioned
3. Amongst which of the following is / are used to analyze the data in pandas. 1
a) Dataframe b) Series c) Both A and B d) None of the mentioned above
4. Amongst which of the following can be used to create various inputs using pandas DataFrame. 1
a) Lists, dict b)Series c) Numpy ndarrays and Another DataFrame d)All of the above mentioned
5. Observe the following code and identify what will be the output when we run following code – 1
import pandas as pd
df = pd.DataFrame()
print (df)
a) Empty DataFrame
Columns: [2]
Index: [3]
b) Empty Series
Columns: [5]
Index: [0]
c) Empty DataFrame
Columns: []
Index: []
d) None of the mentioned above
Page 2 of 8

6. Amongst which of the following is / are not correct to access individual item from dataframe 'df'. 1
a) df.iat[2,2] b ) df.loc[2,2] c) df.at[2,2] d) df[0,0]
7. The plot method on Series and DataFrame is just a simple wrapper around ____________ 1
a) gplt.plot() b) plt.plot() c) plt.plotgraph() d) none of the mentioned
8. Which of the following object you get after reading CSV file? 1
a) DataFrame b) Character Vector c)Panel d) All of the mentioned
9. When e-waste such as electronic circuit boards are burnt for disposal, the elements contained in them 1
create a harmful chemical called ________which causes skin diseases, allergies and an increased risk of
lung cancer.
a) Hydrogen b) Beryllium c) Chlorine d) Oxygen
10. Which of the following constitute e-waste? 1
a) discarded computers b). damaged printers c)useless CDs d). All of the above
11. Which of the following is not a cyber crime? 1
a) Phishing b) Ransomware c)Hacking d)Tracking
12. Write the output of following code 1
import pandas as pd
S1= pd.Series([1,2,3,4])
S2= pd.Series([7,8])
S3= S1 + S2
print (S3.size)

a) 2 b) 6 c) 4 d)8

13. Which of the following value is provided by kind keyword for bar plot? 1
a) bar b) kde c) hexbin d) none of the mentioned
14. The best type of graph to represent distribution of elements is 1.
a) bar b) histogram c) pie d) base map
15. The plot which tells the trend between two graphed variables is the graph/chart. 1
a) line b) scatter c) bar d) pie
16. Read the statements given below and identify the right option to draw a histogram. 1
Statement A: To make a Histogram with Matplotlib, we can use the plt.hist() function.
Statement B: The bin parameter is compulsory to create histogram.
a) Statement A is correct
b) Statement B is correct
c) Statement A is correct, but Statement B is incorrect
d) Statement A is incorrect, but Statement B is correct
Page 3 of 8

17. Assertion (A): To display the first four elements of a Series object, you may write S[:4]. 1
Reason (R): To display the first five rows of a Series object S, you may use tail() function.
a) Both (A) and (R) are True, and (R) is the correct explanation of (A).
b) Both (A) and (R) are True, but (R) is not the correct explanation of
c) (A) is true, but (R) is false. d) (A) is false, but (R) is true.
SECTION B
18. What will be the output of the following: 2
import pandas as pd
D={'a':10,'b':11,'c':12}
S=pd.Series(D,index=['b','c','d','a'])
print(S)
19. What is the role of legends in a graph/chart ? 2
20. Write a short note on data visualization and its significance. 2
21. Write a panda program to read marks detail of Manasvi and Calculate sum of all marks of her 2
subject 'Physics', 'Chemistry', 'English','Maths', 'IP']
22. How is Series data structure different from a Data Frame data structure? 2
23. What will be the output produced by the following code? 2

import pandas as pd
Stationery = ['pencils', 'notebooks', 'scales', 'erasers']
S = pd.Series ([20, 33, 52, 10], index = Stationery)
S2 = pd.Series ([17, 13, 31, 32], index = Stationery)
S = S + S2
print (S + S2)
24. Why is following code not producing any result? Why is it giving errors? 2
(Note. All required libraries have been imported and are available)
a = range (10, 50, 12)
b = range (90, 200, 20)
matplotlib.pyplot.plot(a, b)
25. Consider the code given below (all required libraries are imported) and the output produced by it. Why is 2
the chart showing one bar only while we are plotting four values on the chart?
import matplotlib.pyplot as plt
a = [3, 6, 9, 12]
Page 4 of 8

b = [30, 48, 54, 48]


plt.xlim(-3, 5)
plt.bar(a,b)
plt.show()

26. What is cyber stalking? Explain by taking example. 2


SECTION C
27. Name the functions you will use to create a :- 3
(i) line chart
(ii) bar chart
(iii) scatter chart
28. Why is following code not producing any result? Why is it giving errors? 3
(Note. All required libraries have been imported and are available)
a = range (10, 50, 12)
b = range (90, 200, 20)
matplotlib.pyplot.plot(a, b)
29. Consider the given DataFrame ‘Genre’: 3
Type Code
0 Fiction F
1 Non Fiction NF
2 Drama D
3 Poetry P
Write suitable Python statements for the following:
i. Add a column called Num_Copies with the following data:
Page 5 of 8

[300,290,450,760].
ii. Add a new genre of type ‘Folk Tale' having code as “FT” and 600 number of copies.
iii. Rename the column ‘Code’ to ‘Book_Code’
30. Create two dataframes using the following two Dictionaries.Merge the two dataframes and 3
append the second dataframe as a new column to the first dataframe on the basis of the
manufacturing company’s name.

Car_Price={'Company':['Maruti','Toyota','Honda','BMW','Audi'],
'Price':[350000,800000,4000000,930000,1020000]}
Car_Horsepower={'Company':['Maruti','Toyota','Honda','BMW','Audi'],
'horsepower':[144,150,182,160,170]}
31. Write a Pandas program to select the rows where the height is not known, i.e. is NaN. 3
'name': ['Asha', 'Radha', 'Kamal', 'Divy', 'Anjali'],
'height': [ 5.5, 5, np.nan, 5.9, np.nan],
'age': [11, 23, 22, 33, 22]

SECTION D
32. a) Write the difference between Active and Passive digital footprints 2
b) Mention any three health hazards associated with inappropriate and excessive use of gadgets 3
33. Ms. Anu has invented a software to help blind people to read the books. But she is unaware of how 5
to acquire ownership on the product. Answer the following to help her understand the basics of
Intellectual Property Rights (IPR)
a) Which of the following statements are true.
Statement I: Digital foot print is created due to sending emails, posting on social media etc.,
Statement II: Digital foot print is the one which follow your physical actions
Statement III: Digital foot print lasts forever.
a) Statement I only true b) Statements I & III are true
c) Statement II only true d) All are true
b) Which of the following is true?
Statement I: Hacking is compromising security on digital devices
Statement II: Hacking is unauthorized copying of someone’s literary work
Statement III: Browser hijack is one type of Hacking
Page 6 of 8

Statement IV: Hacking involves stealing password and other digital information
a) Statement I only true b) Statements I & II are true
c) Statement II only true d) Statements I, III, and IV are True
c) Which of the following is true?
Statement I: Firewall protects from unauthorized incoming traffic
Statement II: Firewall can be implemented as both Software and Hardware
Statement III: Firewall grants access to work with a device
a) Statement I and II are only True b) Statement II is only True
c) Statement I is only True d) Statements I, II and III are True
d) Which of the following is True in case of Cyber stalkers
Statement I: Cyber stalkers collect all personal information of the victim
Statement II: Cyber stalkers keep on sending emails to threaten the victim
Statement III: Cyber stalkers are people who save us from hackers
Statement IV: Cyber stalkers post the email of victim on numerous filthy, obscene or illegal websites
a) Statements I, II are True b) Statements I is only True
c) Statements I, II and IV are True d) None of the above are True
e) Which of the following is true in case of Child Pornography
Statement I: Images/movies or texts that depicts sexual activity of anyone under 18 years of age is
Child pornography
Statement II: IT ACT 2000 does not protect from Child Pornography
Statement III: IT ACT section 67 is amended that browsing sites of Child Pornography is also an
offence
a) Statements I and III are True b) Statement II is only True
c) Statement III is only True d) Statements II and III are True
34. HR Department of ABCTech has created following dataframe to store data about salaries and 5
bonus paid to their employees:

import pandas as pd
import numpy as np
d1={'EName':[ 'Kavita', 'Sudha',
'Garima’]'],'Sal':[50000,60000,55000],'Bonus':[3000,4000,5000]}
df1=pd.DataFrame(d1)

Choose the python statement using suitable functions for the following tasks:
Page 7 of 8

1. Display the columns Sal and Bonus


a. df1 [:Sal :Bonus]
b. df1.loc(['Sal','Bonus'])
c. df1.iloc(['Sal','Bonus'])
d.df1[['Sal','Bonus']]

2. Display the details of employee Kavita.


a. df1[df1.EName='Kavita']
b. df1.loc[df1.EName=='Kavita']
c. df1.iloc[df1.EName=='Kavita']
d. df1[EName='Kavita']

3. Display the details of the last employee.


a. Df1.tail(1)
b. Df1.tail (-1)
c. Df1.head(n=1)
d. Df1.head()

4. Add a new column named ‘Email’ with the value “abc@gmail.com”.


a. Df1[‘Email’]= ‘abc@gmail.com’
b. Df1[Email]=’abc@gmail.com’
c. Df1.loc[‘Email’]=’abc@gmail.com’
d. Df1(‘Email’)=’abc@gmail.com’

5. Write a python statement to print the details of employees having Sal more than 50000
a. df1.Sal>=5000
b. df1[df1.Sal>=5000]
c. df1[df1.'Sal'>=5000]
d.df1.iloc[df1.Sal>=5000]

35 Mr. Sharma is working in a game development industry and he was comparing the given chart on 5
the basis of the rating of the various games available on the play store.
Page 8 of 8

He is trying to write a code to plot the graph. Help Mr. Sharma to fill in the blanks of the code and
get the desired output.
import__________________________ #Statement 1
Games=["Subway Surfer","Temple Run","Candy Crush","Bottles
Shot","Runner Best"]
Rating=[4.2,4.8,5.0,3.8,4.1]
plt.______________(Games,Rating) #Statement 2
plt.xlabel("Games")
plt.______________("Rating") #Statement 3
plt._______________ #Statement 4

i. Choose the right code from the following for statement 1.


i. matplotlib as plt
ii. pyplot as plt
iii. matplotlib.pyplot as plt
iv. matplotlib.plt as pyplot

ii. Identify the name of the function that should be used in statement 2 to plot the above graph.
i. line()
ii. bar()
iii. hist()
iv. barh()

iii. Choose the correct option for the statement 3.


i. title("Rating")
ii. ytitle("Rating")
iii. ylabel("Rating")
iv. yaxis("Rating")

iv. Choose the right function/method from the following for the statement 4.
i. display()
ii. print()
iii. bar()
iv. show()

v. In case Mr. Sharma wants to change the above plot to the any other shape, which statement, should he
change.
i. Statement 1
ii. Statement 2
iii. Statement 3
iv. Statement 4

You might also like