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

Sample Question Paper

Term-I
Subject: Informatics Practices (Code-065)
Class – XII
Time Allowed: 90 minutes Maximum Marks: 35
General Instructions:
• The paper is divided into 3 Sections- A, B and C.
• Section A, consists of Questions 1 to 20
• Section B, consists of Question numbers 21 to 30
• Section C, consists of Question numbers 31 to 35
• Student needs to attempt all questions.
• All questions carry equal marks.

Section-A
1)Which method is used to access horizontal subsets of a dataframe?
a.iterrows()
b.sort_values()
c.head()
d.iteritems()

2)In Pandas emp is a Series that stores names of the employees.


emp=pd.Series(“Maya”,”Sushi”,”Manisha”,”Sankar”)
Which command is used to assign the index as (“emp1”,”emp2”,”emp3”,”emp4”)explicitly?
a.emp_index=(“emp1”,”emp2”,”emp3”,”emp4”)
b.emp.index=(“emp1”,”emp2”,”emp3”,”emp4”)
c.emp.index=[“emp1”,”emp2”,”emp3”,”emp4”]
d.emp(index)= (“emp1”,”emp2”,”emp3”,”emp4”)

3)A histogram displays numerical data by grouping data into___of equal width.
a.bars
b.bins
c.ticks
d.rectangles

4)_____refers to tabular data saved as plain text where data values are separated by commas.
a.csv
b.Tables
c.Dataframe
d.Series

5) A ______________ is a unique data trace of a user’s activities, actions, communications or


transactions in digital media.
a. Digital Handprint
b. Digital Footprint
c. Offline Footprint
d. Offline Handprint

6) Which of the following is not a type of cybercrime?


a. Data theft
b. Forgery of online documents
c. Damage to data and systems
d. Installing antivirus for protection
1
7) The term “Intellectual Property Rights”covers:
a.Copyrights
b.Trademarks
c.Patents
d.All of these

8)Individuals with extraordinary computing skills, who use their hacking skills for the common
good.
a. White Hat Hackers
b. Black Hat Hackers
c. Red Hat Hackers
d. Blue Hat Hackers

9)An attempt to acquire sensitive information such as usernames, passwords and credit card details
by masquerading as a trustworthy entity in an electronic communication.
a.Phishing
b.Plagiarism
c.Cyber crime
d.Hacking

10)The command used to make the grid visible in the graph is


a.plt.visible()
b.plt.setgrid(True)
c.plt.grid(True)
d.plt.Grid(True)

11)Choose the correct way to create a Series using Dictionary.


a. S1=pd.Series([“One”:1,”Two”:2,”Three”:3])
b. S1=pd.Series({“One”:1,”Two”:2,”Three”:3})
c. S1=pd.Series((“One”:1,”Two”:2,”Three”:3))
d. S1=pd.Series(“One”:1,”Two”:2,”Three”:3)

12)The Python package used for 2D graphics.


a.matplotlib.pyplot
b.matplotlib.pip
c.mathplotlib.pyplot
d.mathplotlib.plt

13)colors=[‘r’,’g’,’k’,’m’]. Which color does ‘m’stand for?


a.Magnolia
b.Maroon
c.Magenta
d.Mango Yellow

14)Mark Analysis is to be plotted.The command to give title to x-axis as “No.of students” in the
graph .
a.plt.showxaxis(“No.of students”)
b.plt.xlabel(“No.of students”)
c.plt.title(“No.of students”)
d.plt.xaxislabel(“No.of students”)

15)In Pandas the function used to fill the missing values in a dataframe is____

2
a.fillna()
b.missingvalues()
c.missfill()
d.fill()

16)Copying someone else’s work and passing it off as one’s own is ______
a.Phishing
b.Plagiarism
c.Cyber crime
d.Hacking

17)A code of good behaviour while working on the several aspects of internet such as social
media,email online chat is called as ____.

a.Good conduct
b.Etiquette
c.Netiquette
d.Ethical Hacking

18)The legal right to run or the privilege given to you by a company to access their application.
a.Trademark
b.Copyrights
c.Software Licensing
d.Patent

19)The attack upon an individual or group through the use of electronic means such as instant
messaging,social media ,email and other forms of online communication.
a.Cyber Bullying
b.Hacking
c.Phishing
d.Cyber Crime

20)Online personal account,personal websites are examples of:


a.Digital Wallet
b.Digital Certificate
c.Digital Property
d.Digital Signature

Section-B
21)Choose the correct Python statement which can be used to display those who got above 50 Marks
from the series given below.
import pandas as pd
Marks=pd.Series({‘Ram’:45,’Aarya’:48,’Shobita’:35,’Krish’:67})

a.print(Marks[Marks>50])
b.print(Marks(Marks>50))
c.print(Marks[‘Marks’>50])
d.print(Marks[‘Marks’<50])

22)Write the output of the following code:

3
import pandas as pd
a=pd.Series([78,45,89,98])
b=pd.Series([67,87,90])
stud={"English":a,"Hindi":b}
df=pd.DataFrame(stud)
print(df)

Option1 Option2
0 1 2 3 4 English Hindi
English 78.0 45.0 89.0 98.0 0 78 67
Hindi 67.0 87.0 90.0 NaN 1 45 87
2 89 90
3 98 NaN
Option3 Option4
English Hindi
0 78 67.0 0 1 2 3
1 45 87.0 English 78.0 45.0 89.0 98.0
2 89 90.0 Hindi 67.0 87.0 90.0 NaN
3 98 NaN

23)What will be the output of the following program?


import pandas as pd
a=pd.Series([10,20,30,40,50],index=['a','e','i','o','u'])
print(a[a<30])

Option1 Option2

a 10 e 20
e 20 a 10
dtype: int64 dtype: int64
Option3 Option4
a 10 i 30
e 20 e 20
i 30 a 10
dtype: int64 dtype: int64

24)Observe the following figure. Identify the coding for obtaining this as output.

a.import matplotlib.pyplot as plt


plt.plot([1,2,3],[4,5,6])
plt.show()

4
b. import matplotlib.pyplot as plt
plt.plot([1,2,3],[4,5,1])
plt.show()
c. import matplotlib.pyplot as plt
plt.plot([2,3,1],[5,1,6])
plt.show()
d. import matplotlib.pyplot as plt
plt.plot([1,2,3],[5,7,4])
plt.show()
25)A DataFrame ‘toyshop’ contains the following data:
import pandas as pd
Toys = {‘Name’: [‘Talking Tom’,’Blocks’,’Number game’,’Ludo’],’Price’: [400,250,300,150],
’Discount’: [30,20,15,40]}
toyshop=pd.DataFrame(Toys)
Write the command to delete the column “Discount” with all values.
a.toyshop.drop(“Discount”,axis=1)
b.toyshop.drop(“Discount”,axis=0)
c.toyshop.del(“Discount”)
d.pop.toyshop(“Discount”)

26) Consider the following dataframe df as shown below:

What will be the output produced by following statements?


>>>print(df.iloc[:,0:3])

a. b.

c. d.

27) Write the output.


import pandas as pd
D={'one':pd.Series([1.,2.,3.],index=['a','b','c']),'two':pd.Series([1.,2.,3.,4.],
index=['a','b','c','d'])}
df=pd.DataFrame(D)
df1=pd.DataFrame(D,index=['d','b','a'])
5
a. b.
one two one two
d NaN 4.0 d 4.0 NaN
b 2.0 2.0 a 1.0 NaN
a 1.0 1.0
c. d.
one two one two
a 1.0 4.0 a 1.0 4.0
b 2.0 2.0 b 2.0 2.0
d NaN 1.0 d 3.0 1.0

28) The figure shows a line chart.Complete the code to draw black color,dotted line with circle
marker.

import matplotlib.pyplot as pline


data=[1,11,21,31,41]
pline.plot(data,____)
pline.show()

a. pline.plot(data, ‘c- -b’)


b. pline.plot(data, ‘o…k’)
c. pline.plot(data, ‘o:k’)
d. pline.plot(data, ‘o-.b’)

29) Consider the following DataFrame. (2)


import pandas as pd
df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
print(df)
A B
0 1 4
1 2 5
2 3 6
Write the command to rename the column name from ‘B’ to ‘D’ of DataFrame.
A D
0 1 4
1 2 5
2 3 6
a. df.rename(columns={'B':'D'},inplace=False)
b. df(columns={'B':'D'},inplace=True)
c. df.rename(columns=['B','D'],inplace=True)
d. df.rename(columns={'B':'D'},inplace=True)

30) Consider the DataFrame df given below.


6
Write the command to change the index from H_1, H_2, H_3 to 101,102,103
a. df.setindex=[101,102,103]
b. df.reindex=[101,102,103]
c. df.index=[101,102,103]
d. df.resetindex=[101,102,103]
Section-C

Assume a DataFrame df that contains data about Science Quiz.


School Totalstud winner runnerup
SC1 NMS 40 32 8
SC2 ISB 60 42 12
SC3 ASB 30 12 10
SC4 BIS 20 8 4
SC5 NIS 50 22 11
31)WRITE the command to get the following output.

SC2 42
SC3 12
SC4 8
Name: winner, dtype: int64

a. df.loc[‘SC2’:’SC4’,’winner’]
b. df.loc[‘SC2’:’SC5’,’winner’]
c. df.iloc[‘SC2’:’SC4’,’winner’]
d. df.iloc[‘SC2’:’SC5’,’winner’]

32) Based on the DataFrame choose the correct the output for df.iloc[2:4]
a. b.
School Totalstud winner runnerup School Totalstud winner runnerup
SC4 BIS 20 8 4 SC1 NMS 40 32 8
SC5 NIS 50 22 11 SC2 ISB 60 42 12
c. d.
School Totalstud winner runnerup School Totalstud winner runnerup
SC3 ASB 30 12 10 SC4 BIS 20 8 4
SC4 BIS 20 8 4 SC5 NIS 50 22 11

33)Write the command to get the output


SC1 40
SC2 60
SC3 30
SC4 20
SC5 50
Name: Totalstud, dtype: int64

7
a. print(df[Totalstud])
b.print(df.Totalstud)
c. print(df(Totalstud))
d. print(df(df.Totalstud))

34)What is the output of the command print(df.shape)

a.(4,5)
b.(6,4)
c.(5,4)
d.(5,5)

35)Write the command to display the records in ascending order of Totalstud.

a. print(df.sort_values['Totalstud'])
b. print(df.sortvalues('Totalstud'))
c. print(df.sort_values(Totalstud))
d. print(df.sort_values('Totalstud'))

You might also like