Sample Paper Class 12 Informatics Practices Term 1 Set A

Section A

Question 1. The program that installs modules like pandas and matplotlib in Python is
(a) pinstall
(b) pip
(c) pyinstall
(d) python-install

Answer

B

Question 2. Python programs are saved with an extension of
(a) .pyprog
(b) .prog
(c) .py
(d) .ppt

Answer

C

Question 3. The labels associated with the values of a series are called
(a) Data value
(b) index
(c) Left index
(d) parameter

Answer

B

Question 4. Dataframe column indexes usually start with
(a) 1
(b) ‘a’
(c) ‘i’
(d) 0

Answer

D

Question 5. How many elements will be there in the Series?
import pandas as pd
Myseries=pd.Series(range(1,20,2))
(a) 11
(b) 9
(c) 10
(d) 12

Answer

C

Question 6. The matplotlib.pyplot module does not carry which of the following function?
(a) scatter()
(b) hist()
(c) head()
(d) plot()

Answer

C

Question 7. To create an empty series object, you can use
(a) import pandas as pd
(b) import pandas as pd
s=pd.Series(empty) s=pd.Series()
(c) s=pd.Empty
(d) None of these

Answer

B

Question 8. The data type of an empty series is
(a) int64
(b) String
(c) float64
(d) Boolean

Answer

C

Question 9. Given a series “s” carrying the values [12,45,67,98,30] , the statement to extract the last two elements is
(a) s.end(2)
(b) s[-2]
(c) s(2)
(d) s.tail(2)

Answer

D

Question 10. The …………… function resets the index that has been changed using set_index().
(a) reset()
(b) resetindex()
(c) change_index()
(d) reset_index()

Answer

D

Question 11. Which of the following is not a demerit of internet technology?*
(a) Health hazards
(b) Data theft
(c) Access of immense information
(d) Cyber crimes

Answer

C

Question 12. Linux, Apache and OpenOffice belong to which category of softwares?
(a) Open source softwares
(b) Proprietary softwares
(c) Shareware softwares
(d) Freeware softwares

Answer

A

Question 13. Which of the following is not a cyber crime?
(a) Sending offensive mails
(b) Posting rumours in social networks
(c) Trying to guess password of others
(d) All of the above

Answer

D

Question 14. Which of the following function is used to return each index value along with a series containing the data in each row?
(a) iterrows()
(b) iteritems()
(c) itertuples()
(d) All of these

Answer

A

Question 15. Sohini wants to keep herself protected from malwares and cyber crimes . Which among the following she should do?
(a) Not sharing of her E-mail id with unknown people
(b) Not visiting suspicious sites
(c) Look for https:// in the URL
(d) All of the above

Answer

D

Question 16. A spyware is
(a) a malware that steals and performs spying of data in systems illegally
(b) a software that protects network users from viruses
(c) a gaming software
(d) a malware that duplicate files on system

Answer

A

Question 17. The pop() function when used with a series requires ……… parameter(s).
(a) 1
(b) 2
(c) 0
(d) 3

Answer

A

Question 18. A program designed to protect web sites from bots by generating random tests that humans can pass but computer programs cannot.
(a) Firewall
(b) Captcha
(c) Randomization
(d) None of these

Answer

B

Question 19. The index of a series can be
(a) integer
(b) float
(c) string
(d) All of these

Answer

D

Question 20. The digital trails we keep unintentionally are called ……………
(a) active digital footprints
(b) external footprints
(c) personal footprints
(d) passive digital footprints

Answer

D

Question 21. Trolling is not meant for
(a) provoking others on the web
(b) upsetting someone
(c) stealing data
(d) None of these

Answer

C

Question 22. Which one of the following is not an instance of cyber stalking?
(a) Vandalism
(b) Threats
(c) Identity theft
(d) None of these

Answer

D

Question 23. The statement S1=pd.Series([14,7],index=[‘a’,‘b’,‘c’]) will
(a) create the series properly
(b) produce an error
(c) create the series with one value NaN
(d) create the series with one value 0

Answer

B

Question 24. The property of a series that checks whether it has NaN or not.
(a) Nans
(b) isNan
(c) hasnans
(d) There is no such property

Answer

C

Question 25. Which of the following is true about a dataframe creation?
(a) It can be created from lists
(b) It can be created from dictionaries
(c) It can be created from series
(d) All are true

Answer

D

Section B

Question 26. Given a Series created as :
s=pd.Series(range(1,9,3),index=[‘a’,‘b’,‘c’])
What will be the output of the print statement?
s=s*3
if s[a]>5:
s[a]=s[a]*2
print(s)
(a) a 3
     b 24
     c 42
(b) a 3
 b 24
(c) a 3
(d) None of these

Answer

A

Question 27. Given a series “films” created as:
import pandas
films=__________([12,55,88,99],index=[‘a’,’b’,’c’,’d’])
What should be filled in the blank to create the series properly?
(a) p.Series
(b) pd.Series
(c) Series(films)
(d) pandas.Series

Answer

D

Question 28. Paromita wanted to create a series “rseries” whose data would be a list “lst” and indexes would be the values 1,3,5,7,9, what statement is to be written for this?
(Assuming pandas is imported as p)
(a) rseries=p.Series(lst,index=range(1,10,3))
(b) rseries=p.Series(lst,index=range(1,10))
(c) rseries=p.Series(lst,index=range(1,10,2))
(d) rseries=p.Series(lst,index=[1,3,5,7])

Answer

C

Question 29. Smriti had just finished writing her e-Book on Science fiction. To her surprise she found exactly the same contents were released by another author before her. This is a case of
(a) spamming
(b) phishing
(c) plagiarism
(d) stalking

Answer

C

Question 30. Given the following plot , the code to show the top heading “Programming Language
Usage” will be :

Sample Paper Class 12 Informatics Practices Term 1 Set A

(a) import matplotlib.pyplot as p
p.title(“Programming Language Usage”)
(b) import matplotlib.pyplot as p
p.show(“Programming Language Usage”)
(c) import matplotlib.pyplot as p
p.heading(“Programming Language Usage”)
(d) None of the above

Answer

A

Question 31. Statement A To plot a line chart the plot() function is used.
Statement B The color of the line in a line chart can be changed by the ‘‘vision’’ property.
(a) Statement A is correct, but B is incorrect.
(b) Statement A is incorrect, B is correct.
(c) Both statements are correct.
(d) Both statements are incorrect.

Answer

A

Question 32. The role of the savefig() function is
(a) to save a dataframe
(b) to save a series
(c) to save a list
(d) to save a chart

Answer

D

Question 33. Debarati has a set of exhausted batteries , what is the proper treatment of those?
(a) Throw them into water
(b) Dispose them in the soil
(c) Dispose them to a proper e-Waste collector
(d) Give them to a child for play

Answer

C

Question 34. Given statements regarding FOSS
Statement A They cannot be modified.
Statement B Their source code is available.
Statement C They are free.
Statement D They must have a price associated.
Which of the following statements correctly characterise FOSS?
(a) Statements A and B
(b) Statements B and C
(c) Statements C and D
(d) Statements B and D

Answer

B

Question 35. Given the following code to create a series:
import pandas as pd
S1 = pd.Series(data = (31, 2, -6), index = [7, 9, 3, 2])
The result of the statement , on execution will be
(a) series will be created properly
(b) ValueError
(c) NameError
(d) IndexError

Answer

B

Question 36. Which of the following crimes are not under jurisdiction of ITA-2000?
(a) Unable to maintain records
(b) Posting obscene material
(c) Child pornography
(d) All are under jurisdiction of ITA -2000

Answer

D

Question 37. Which of the following is an example of boolean indexing?
(a) d1={‘roll’:[10,11,12],’name’:[‘Ram’,’Rahim’,’Sita’]}
df1=p.DataFrame(d1,index=[True,False,True])
(b) d1={‘roll’:[10,11,12],’name’:[‘Ram’,’Rahim’,’Sita’]}
df1=p.DataFrame(d1,index=[false,true,true])
(c) d1={‘roll’:[10,11,12],’name’:[‘Ram’,’Rahim’,’Sita’]}
df1=p.DataFrame(d1,index=[1,2,3])
(d) None of the above

Answer

A

Question 38. The term DOS attacks in networks refers to
(a) Digital Online Services
(b) Digital Online Server
(c) Denial of Services
(d) None of these

Answer

C

Question 39. The number of columns in the dataframe created by the following code is
import pandas as pd
DFT = [{‘a’:10, ‘b’:20}, {‘a’:5, ‘b’:10, ‘c’:20}]
D1 = pd.DataFrame(DFT)
(a) 2
(b) 1
(c) 4
(d) 3

Answer

D

Question 40. A series is created as :
Poetseries = pd.Series([‘Kavi’,‘Shyam’,‘Ravi’], index=[3,5,1])
print(Poetseries >= ‘S’)
(a) 3 False
(b) 3 False
     1 False
(c) 5 True
(d) 3 False
     5 True
     1 False

Answer

D

Question 41. CFC stands for
(a) Clean Fluorescent Carbon
(b) Chloro Fluoro Carbon
(c) Common Food Categories
(d) None of these

Answer

B

Question 42. Given a dataframe “Paint” carrying the following data of paints:
Index    Pno         Pname Cost
0 123    Royale    1700
1 234    Berger    1250
2 345    Deluxe    500
The statement to display the rows where Cost >1000 is
(a) Paint[Paint[‘Cost’]>20]
(b) Paint[Paint[Cost]>20]
(c) Paint[Paint.‘Cost’>20]
(d) Paint[Paint[‘Cost’] greater than 20]

Answer

A

Question 43. Given a dataframe “Empdf” storing the following :
     EmpId     Ename     Aadhar
0   P/01      John        34568899
1   P/02      Smith      99887755
2   P/03      Rohit       77665433
The statement to remove, the Aadhar column from the dataframe is
(a) del Empdf[‘Ename’]
(b) del Emp[4]
(c) del Empdf[‘Aadhar’]
(d) None of these

Answer

C

Question 44. Given two series :
S1 = pd.Series([1, 2, 3, 4], index = [‘a’, ‘b’,‘c’,‘d’])
S2 = pd.Series([11, 22, 33, 44], index = [‘a’, ‘bb’,‘c’,‘dd’])
If a dataframe is created as
D1 = pd.DataFrame([S1,S2])
print(D1)
Find the output.

Sample Paper Class 12 Informatics Practices Term 1 Set A

(d) None of the above

Answer

C

Question 45. A dataframe Studdf is as follows :
    SName     AISSE    AISSCE
0   Shreya    20          30
1   Rakhi      23          50
2   Priya       45          90
To set the dataframe to 100 for all elements, the correct statement is
(a) Studdf[: : ]=100
(b) Studdf[: ]=100
(c) Studdf[ ]=100
(d) Both (a) and (b)

Answer

D

Question 46. Mr. Satya Narayan created a dataframe “Friends” storing the names and addresses of his 3 Friends as follows :
           Friends
   Name      Address
0 Monti       Ranaghat , WB
1 Kakoli      Kalyani
2 Tapan      Kolkata
Now, he wants to change the address list to [‘Ranaghat,WB’,’New Jersey’,’Melbourne’].
The statement that he has to write is
(a) Friends[‘Address’]= [‘Ranaghat,WB’,‘New Jersey’,‘Melbourne’]
(b) Friends[]= [‘Ranaghat,WB’,‘New Jersey’,‘Melbourne’]
(c) Friends[1]= Friends[‘Address’]= [‘Ranaghat,WB’,‘New Jersey’,‘Melbourne’]
(d) All of the above

Answer

A

Question 47. Which of the following is characterised by attempting to fraudulently acquire sensitive information by masquerading?
(a) Plagiarism
(b) Phishing
(c) Bullying
(d) License

Answer

B

Question 48. Given a dataframe Doctor:
Index    Dno    Dname     Dept
0          123     R.Rai        Eye
1          124     P. Roy      Ortho
2          125     D.Sen      ENT
The command to remove the columns Dname,Dept will be
(a) Doctor =Doctor.drop[‘Dname’,‘Dept’,axis=1]
(b) Doctor =Doctor.drop[‘Dname’,‘Dept’]
(c) Doctor =Doctor.drop([‘Dname’,‘Dept’],axis=1)
(d) Both (a) and (b)

Answer

C

Question 49. A series Teacher is created as follows :
0   T
1   E
2   A
3   C
4   H
5   E
6   R
The command to display the last element of the series is
Statement A print(Teacher.tail(1))
Statement B print(Teacher.loc[6:])
(a) Both statements are correct.
(b) Both statements are incorrect.
(c) Statement A is correct, Statement B is incorrect.
(d) Statement A is incorrect, Statement B is correct.

Answer

A

Section C

(Case Study Based Questions)

Mr. Rakesh Malhotra wants to create a bar chart showing the sales of his company in 4 Quarters of year 2010. The data of sales is given as follows :
Quarter1 :200 , Quarter 2: 150, Quarter 3 : 300, Quarter 4 : 900
He imported the required module as follows :
import matplotlib as plt #L1
He created a list storing data of all the quarters
yr2010=[200,150,300,900]
Help him in plotting the data properly.

Question 50. The correct statement in L1 would be
(a) import matplotlib.bar as plt
(b) import matplotlib.plot as plt
(c) import matplotlib.pyplot as plt
(d) No error

Answer

C

Question 51. The statement to plot the bar chart is
(a) Plt.bar([‘Apr-Jun’,‘July-Sep’,‘Oct-Dec’,‘Jan-Mar’],yr2010)
(b) plt.barchart([‘Apr-Jun’,‘July-Sep’,‘Oct-Dec’,‘Jan-Mar’],yr2010)
(c) plt.bar([‘Apr-Jun’,‘July-Sep’,‘Oct-Dec’,‘Jan-Mar’],yr2010)
(d) None of the above

Answer

C

Question 52. To give the color of the bars as ‘Red’ the parameter to the bar() function will be
(a) frontcolor=‘r’
(b) edgecolor=‘r’
(c) barcolor=‘r’
(d) color=‘r’

Answer

D

Question 53. To make the bar chart horizontal, the bar() function is to be replaced by
(a) bargraph()
(b) horizontalbar()
(c) barh()
(d) None of these

Answer

C

Question 54. Even after plotting the bar chart he is unable to view it. What command has to be  written for displaying the chart?
(a) Plt.display()
(b) plt.display()
(c) plt.show()
(d) barplot.show()

Answer

C

Question 55. The statement to be added to add a x-axis title “Quarters” is
(a) plt.xtitle(“Quarters”)
(b) xtitle=“Quarters”
(c) plt.x_title=“Quarters”
(d) plt.xlabel(“Quarters”)

Answer

D

Related Posts

error: Content is protected !!