Class 12 Informatics Practices Sample Paper Term 1 Set B

Sample Paper Class 12

Section A

Question 1. Which of the following are features of pandas?
(a) Finding data
(b) Filling data
(c) Selecting subsets from bulky sets
(d) All of the above

Answer

D

Question 2. The values of a series cannot come from
(a) lists
(b) expressions
(c) reset() function
(d) range() function

Answer

C

Question 3. The function that uses label based indexing is
(a) iloc()
(b) loc()
(c) search()
(d) Both (a) and (b)

Answer

B

Question 4. Which of the functions are used for looping through the values of a dataframe?
(a) iterrecords
(b) iterrows()
(c) iteritems()
(d) Both (b) and (c)

Answer

D

Question 5. The function that inserts a column at any index of a dataframe is
(a) add()
(b) insert()
(c) put()
(d) insertcol()

Answer

C

Question 6. The pandas module can be imported as
(a) pd only
(b) p only
(c) Any alias following the identifier naming rules
(d) int

Answer

B

Question 7. If a dataframe is created from list of dictionaries , the number of rows in the dictionary will be
(a) number of keys in the first dictionary
(b) number of keys in the last dictionary
(c) number of dictionaries in the list
(d) None of the above

Answer

C

Question 8. The ……….. function displays a horizontal bar chart.
(a) bar()
(b) barh()
(c) barchart()
(d) barplot()

Answer

B

Question 9. When a dictionary creates a dataframe , the keys of the dictionary become the labels of the
(a) rows
(b) columns
(c) Both (a) and (b)
(d) Neither (a) nor (b)

Answer

B

Question 10. A new column is added at the ………… of a dataframe.
(a) left
(b) specified index
(c) right
(d) index 1

Answer

C

Question 11. Which of the following is not true about a freeware?
(a) Available free of cost
(b) Can be modified
(c) Can be copied
(d) Can be redistributed

Answer

B

Question 12. Purchasing only one licensed copy of a software and distributing and loading it onto multiple systems is called
(a) renting
(b) softlifting
(c) counterfeiting
(d) loading

Answer

B

Question 13. Which of the following are instances of keeping passive digital footprints?
(a) Apps that use geolocation to pinpoint our location.
(b) Using cookies to keep user information.
(c) Social networking sites that see our comments and likes to serve information accordingly.
(d) All of the above

Answer

D

Question 14. How many columns will be there in the dataframe created by the code?
df=pd.DataFrame({‘X’:[78,85,96,80,86],‘Y’:[84,94,89,83,86],
‘Z’:[86,97,96,72,83]});
(a) 3
(b) 6
(c) 2
(d) 1

Answer

A

Question 15. What can be the risks due to digital footprints?
(a) Scam
(b) Privacy concerns
(c) Both (a) and (b)
(d) Loss of intellectual property

Answer

C

Question 16. Which of the following are good netiquette?
(a) Help others and respect them
(b) Promptly check messages and mails
(c) Reposting without checking
(d) Both (a) and (b)

Answer

D

Question 17. If a dataframe “df” has 3 rows , with columns “Roll”,”Name”,”Marks”, the statement df[“Roll”]=[1] will
(a) assign 1 to the Roll of the first row
(b) assign 1 to the Roll of all the rows
(c) give an error
(d) assign 1 to all values of the dataframe

Answer

C

Question 18. Ronita found that the paid documentation software. She was using for make her documents could not be interpreted by her friend as her friend did not have the software as it was a paid software, what can she do?
(a) She can tell her friend to buy the software
(b) She can copy the software to her friend’s computer
(c) She can use a free and open source software
(d) She will stop sharing the documents

Answer

C

Question 19. The loc() function cannot be used for
(a) adding a row to a dataframe
(b) changing data of a column in a dataframe
(c) removing data in a series
(d) Both (a) and (b)

Answer

C

Question 20. A patent is usually used to protect rights on a/an
(a) physical property
(b) invention
(c) books
(d) None of these

Answer

B

Question 21. Which among the following is not benefit of an open source software?
(a) Collaborative work
(b) Encouragement for new innovations
(c) Produces funds for developers
(d) More sources of development

Answer

C

Question 22. Which among the following are activities not done by cyber criminals?
(a) Blackmailing
(b) E-mail fraud
(c) Banking fraud
(d) Stealing jewellery

Answer

D

Question 23. What will be the size of the series ’S1‘?
S1=pd.Series([12,10–2,8,9])
(a) Code has error
(b) 3
(c) 4
(d) 5

Answer

C

Question 24. The default indexing in pandas is
(a) positional index
(b) sliced index
(c) labelled index
(d) valued index

Answer

A

Question 25. A series can be sliced only if , the values are
(a) integers
(b) strings
(c) floats
(d) All of these

Answer

D

Section B

Question 26. To create a series storing the data and index as follows, the statement will be:
Index    Value
24         12
27         14
30         16
33         18
(a) import pandas as pd
s1=pd.Series(range(12,30,2),index=range(24,40,3))
(b) import pandas as pd
s1=pd.Series(range(12,20,2),index=range(24,34,3))
(c) import pandas as pd
s1=pd.Series(range(11,20,2),index=range(24,34,2))
(d) import pandas as pd
s1=pd.Series(range(10,20,2),index=range(22,34,3))

Answer

B

Question 27. Given a series “Stones” storing the following data:
Index      Values
0             Diamond
1             Emerald
2             Coal
3             Ruby
The statement to be written, to get the output as:
3 Ruby
(a) Stones.tail(1)
(b) Stones.iloc[3:]
(c) Stones.loc[3:4]
(d) All of these

Answer

D

Question 28. Mr. John has created a series “Wood” storing the following
Index         Value
S                Sal
P                Plywood
M               Mahogany
To print the entire series the command that will not work is
(a) print(Wood[:])
(b) print(Wood[0:])
(c) print(Wood[1:3 ])
(d) Both (a) and (c)

Answer

C

Question 29. Which of the statements is incorrect about an ethical hacker?
(a) Finds loopholes in a website.
(b) Reports the loopholes to the web site owner.
(c) Uses the loopholes to gain.
(d) Both (a) and (b)

Answer

C

Question 30. Given the following plot

Class 12 Informatics Practices Sample Paper Term 1 Set B

The code for the above plot and to show it , can be
(a) import matplotlib.pyplot as plt
data=[5,15,25,35,45,55]
plt.hist(data,bins=[0,10,20,30,40,50,60],weights=[20,10,45,33,0,8])
plt.show()
(b) import matplotlib.pyplot as plt
data=[5,15,25,35,45,55]
plt.Hist(data,bins=[0,10,20,30,40,50,60],weights=[20,10,45,33,70,8],edgecolor=‘red’)
plt.show()
(c) import matplotlib.pyplot as plt
data=[5,15,25,35,45,55]
plt.bar(data,bins=[0,10,20,30,40,50,60],weights=[20,10,45,33,6,8],edgecolor=‘red’)
plt.show()
(d) import matplotlib.pyplot as plt
data=[5,15,25,35,45,55]
plt.histogram(data,bins=[0,10,20,30,40,50,60],weights=[20,10,45,33,80,8],edgecolor=‘red’)
plt.show()

Answer

A

Question 31. Given below are two statements:
Statement A The y-axis label is shown by the label() function.
Statement B The font size of the label can be changed by fontsize property.
(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.

Answer

D

Question 32. Which of the following do not characterise a histogram?
(a) There is no gap between the bars.
(b) It is plotted using the histogram() function.
(c) It does not show individual value but represents number of people in a range.
(d) Both (a) and (c)

Answer

B

Question 33. Which of the following activities will create a digital footprint?
(a) Bullying someone over the web
(b) Sending an E-mail
(c) Posting comments on someone’s upload
(d) All of the above actions

Answer

D

Question 34. Given statements regarding health issues caused due to excessive use of technology.
Statement A Over use of Internet technology can cause repetitive strain injury.
Statement B It can create sleeping disorders.
Statement C It can lead to fear towards studies.
Statement D Skin problems are also reported.
Which of the statements justify proper use of Internet?
(a) Statement A and Statement B
(b) Statement B and Statement C
(c) Statement C and Statement D
(d) Statement B and Statement D

Answer

A

Question 35. Given the following code for a series creation:
s1=pd.Series([1,2,3,4])
print(s1[0:2]*2)
The output of the code will be
(a) 0   2
     1  4
dtype: int64
(b) 2
     4
dtype: int64
(c) 0  3
     1  6
     2  9
dtype: int64
(d) Arithmetic operations cannot be done on slices

Answer

A

Question 36. Blog streaking means
(a) posting improper blogs
(b) removing other’s blogs
(c) intention to spread information online that should not be known to all
(d) None of the above

Answer

C

Question 37. Which of the statements will create a series containing values as the output of  multiplication table of 5?
(a) s = pd.Series(range(5,5,5))
(b) s = pd.Series(range(5,5*11))
(c) s = pd.Series(range(5,51,5))
(d) All of these

Answer

C

Question 38. Which of the following are results of Internet addiction?
(a) Ego surfing
(b) Infornography
(c) Blog streaking
(d) All of these

Answer

D

Question 39. What is the difference between the head() and tail() functions?
(a) head() displays the top n values, tail() displays bottom n values.
(b) head() displays the heading of a series , tail() displays the data type of a series.
(c) head() displays the index of the series , tail() displays the values of the series.
(d) None of the above

Answer

A

Question 40. Given the series:
s=pd.Series([1,2,3,4,5])
The result of the operation:
s1=s+s*2
print(s1[3:])
(a) 3   12
     4   15
(b) 2   9
     3   12
(c) 4   15
(d) 2   9
     3   4
    12  15

Answer

A

Question 41. Photo lurking is
(a) blocking others photos
(b) posting comments on others photos
(c) looking at the photo albums of others
(d) deleting others photos from the web

Answer

C

Question 42. To display the number of bytes occupied by the ‘Name’ column (2nd column) of a dataframe “df” the command would be
(a) df.size
(b) df[1].size
(c) df[‘Name’].nbytes
(d) Both (b) and (c)

Answer

C

Question 43. Given a Series created by the statements:
s1=pd.Series([1,2,3,4,5])
The loop:
for a in s1.index:
if a>2:
print(s1[a]*3,end=’@’)
will display
(a) 12@15
(b) 9@12@15@
(c) 12@
(d) 12@15@

Answer

D

Question 44. Mr. Robert wants to create a dataframe “Univ” storing names of some Indian  universities and their ranks as follows . Help him to create the dataframe:
Index    University    Rank
0           Calcutta        3
1           Delhi            12
2           BHU              9
The statement to create the dataframe will be
(a) import pandas as pd
Univ = pd.Dataframe({‘University’:[‘Calcutta’,‘Delhi’,‘BHU’],‘Rank’:[3,12,9]})
(b) import pandas as pd
Univ = pd.dataframe((‘University’:[‘Calcutta’,‘Delhi’,‘BHU’],‘Rank’:[3,12,9]))
(c) import pandas as pd
Univ = pd.DataFrame({‘University’:[‘Calcutta’,‘Delhi’,‘BHU’],‘Rank’:[3,12,9]})
(d)None of the above

Answer

C

Question 45. Which of the following are mediums of online trolling?
(a) YouTube comments
(b) Blog comments
(c) E-mail comments
(d) All of these

Answer

D

Question 46. A dataframe “Paper” consists of different size of papers and their prices as follows:
Index   Pcode   Size   Price
0         P1          A4     220
1         P2          A5     310
2         P3          B5     120

To add a column storing the discount (Column name :“Disc” ) calculated as 10% of the Price , the statement will be
(a) Paper.add(‘Disc’)=Paper[‘Price’]*0.1
(b) Paper[‘Disc’]=Paper[‘Price’]*0.1
(c) Paper.modify(‘Disc’)=Paper(‘Price’)*0.1
(d) Paper[‘Disc’]=Paper[‘Price’]*0.5

Answer

B

Question 47. A dataframe “Pencil” storing data of pencils is given below:
Index    Pname      Type
0            HB            Dark
1           QR            Extra dark
2           Silver       Color
3           ST             OMR
What will be the output of the code Pencil.loc[2:2,’Type’]?
(a) Color
(b) Extra dark
(c) OMR
(d) Empty set

Answer

A

Question 48. A dataframe ”DishTV” stores the following data:
Index    Brand       Frequency
0          Tata Sky     45
1          Dish TV      35
2          Sun            20
The output of the command DishTV. loc[1:1,’Frequency’]/2 would be
(a) 17
(b) 17.5
(c) Error
(d) 18

Answer

B

Question 49. Given the statements with respect to Python dictionaries:
Statement A The keyword “imports“ is used to import matplotlib .
Statement B The module needs to be imported whenever a new session is started.
(a) Both statements are correct.
(b) Both statements are incorrect.
(c) Statement A is correct , but Statement B is incorrect.
(d) Statement A is incorrect , but Statement B is correct.

Answer

D

Section C

(Case Study Based Questions)

Roma wants to create a dataframe “Vehicle” comprising of some vehicles and their prices . She also wants to perform some operations on the dataframe , like additions ,modification , arrangement of the data etc. Help her to perform the operations.
Index    Vehicle     Wheels     Price
0          Truck        8             820000
1          Car           4             560000
2          Moped      2             125000
3          eBike        2             150000

Question 50. The command to create the dataframe using a series will be
(a) import pandas as pd
Vehicle=pd.dataframe({‘Vehicle’:pd.Series([‘Truck’,‘Car’,’Moped’,‘eBike’]),‘Wheels’:
pd.Series([8,4,2,2]),‘Price’:pd.Series([820000,560000,125000,150000])})
(b) import pandas as pd
Vehicle=pd.DataFrame({0:pd.Series([‘Truck’,‘Car’,‘Moped’,‘eBike’]),1:
pd.Series([8,4,2,2]),2:pd.Series([820000,560000,125000,150000])})
(c) import pandas as pd
Vehicle=pd.DataFrame({‘Vehicle’:pd.Series([‘Truck’,‘Car’,‘Moped’,‘eBike’]),
‘Wheels’pd.Series([8,4,2,2]), ‘Price’:pd. Series([820000,560000,125000,150000])})
(d)Dataframe cannot be created using series

Answer

C

Question 51. The statement to make the price as 50% of the current prices will be
(a) Vehicle[‘Price’]=50%
(b) Vehicle[‘Price’]=Vehicle[‘Price’]*0.5
(c) Vehicle[‘Price’]=Vehicle[‘Price’]%2
(d) Dataframes are not editable

Answer

B

Question 52. To get the output as (4,3) the command will be
(a) Vehicle[‘Price’].nbytes
(b) Vehicle.size
(c) Len(Vehicle)
(d) Vehicle.shape

Answer

D

Question 53. To modify the values of ‘Wheels’ column by values [9,5,3,2], the statement will be
(a) Vehicle[‘Wheels’]= [9,5,3,2]
(b) ‘Wheels’= [9,5,3,2]
(c) [‘Wheels’].Vehicle= [9,5,3,2]
(d) None of these

Answer

A

Question 54. To view only the contents of the ‘Wheels’ column, the command will be
(a) Vehicle[‘Wheels’]
(b) Vehicle.Wheels
(c) Both (a) and (b)
(d) Wheels

Answer

C

Question 55. To remove the column ‘Price’ permanently ,the command will be
(a) Vehicle.pop(‘Price’)
(b) Vehicle.drop(‘Price’)
(c) Vehicle.drop(‘Price’,axis=1)
(d) Vehicle.clear(‘Price’)

Answer

A