Class 12 Informatics Practices Sample Paper Term 1 Set A

Sample Paper Class 12

Section A

Question 1. The default delimiter of a CSV file is
(a) ,
(b) :
(c) .
(d) ;

Answer

A

Question 2. To iterate through the rows of a DataFrame, row-wise the function used is
(a) iterrows()
(b) iteritems()
(c) iterrecords()
(d) itertuples()

Answer

A

Question 3. A line chart can plot
(a) a single line
(b) 2 lines
(c) 3 lines
(d) multiple lines

Answer

D

Question 4. How many values will be there in the series created by the following statement?
import pandas as pd
s=pd.Series(100,index=range(-10,-1,-4))
(a) 1
(b) 2
(c) 4
(d) Empty set

Answer

D

Question 5. import numpy as np
import pandas as pd
s=pd.Series([1,np.NaN,2,3,np.NaN])
print(s.count())
The output of the above code is
(a) 3
(b) 5
(c) 0
(d) None of these

Answer

A

Question 6. The term not related to pandas is
(a) index
(b) series
(c) head()
(d) stack

Answer

D

Question 7. The indexes of a series can be
(a) integers
(b) characters
(c) strings
(d) All of these

Answer

D

Question 8. Indexes of a series can be
(a) duplicate
(b) must be unique
(c) can be duplicate, if indexes are numbers
(d) can be duplicate, if indexes are strings

Answer

A

Question 9. The column labels of a dataframe can be
(a) only assigned while creation
(b) can be assigned at any point of time
(c) columns can only have system defined indexes
(d) None of the above

Answer

B

Question 10. Which of the following operation is not a part of pandas module?
(a) Data query
(b) Data storage in one and two-dimensional structures
(c) Data analysis
(d) Data visualisation

Answer

D

Question 11. Rony received bulk amounts of unnecessary E-mails in his mailbox, what kind of threat is this?
(a) Hacking
(b) Phishing
(c) Data theft
(d) Spamming

Answer

D

Question 12. Nisha wanted a software for her official documentation work, but she does not want to pay for it. Which type of software she should procure?
(a) Closed software
(b) Free software
(c) Commercial software
(d) Proprietary software

Answer

B

Question 13. John was using an antivirus software for free for a month , one morning he found the software stopped working saying that it needs to be bought. What category of software does it belong to?
(a) Proprietary software
(b) Free software
(c) Freeware software
(d) Shareware software

Answer

D

Question 14. The minimum number of parameters required by the Series() function to create a non-empty series is
(a) 1
(b) 0
(c) 3
(d) 4

Answer

A

Question 15. Which of the following are not the health hazards of technology?
(a) Musculoskeletal problems
(b) Vision problems
(c) Heart problems
(d) Sleeplessness

Answer

C

Question 16. Robert is confused between the terms FOSS and OSS, the statement that clarifies it is.
(a) FOSS is OSS that is free.
(b) FOSS is not open source , but OSS is open source.
(c) FOSS is to be bought , but OSS is not paid.
(d) FOSS is limited period use , but OSS is free for unlimited period.

Answer

A

Question 17. The tail() function without any parameters extracts ……… number of rows from end of a series.
(a) 1
(b) 2
(c) 5
(d) 0

Answer

C

Question 18. Which of the following acts are not done by cyber criminals?
(a) Report vulnerability in any system
(b) Mass attack using trojans
(c) Email spoofing and spamming
(d) Unauthorised account access

Answer

A

Question 19. The statement used to change the name of the index of a Series “s” is
(a) s.name=newname
(b) s.index.name=”newname”
(c) s.indexname=”newname”
(d) s.index_name=”newname”

Answer

B

Question 20. Albert found that while logging to his E-mail account , the password was coming automatically , what is responsible for this?
(a) Trojans
(b) Viruses
(c) Cookies
(d) Password manager

Answer

C

Question 21. The least dangerous type of malware is
(a) worm
(b) spyware
(c) spamming
(d) virus

Answer

C

Question 22. Which one of the following is not a netiquette?
(a) Cyber bullying
(b) Don’t troll people in web forums
(c) Respecting others privacy
(d) Do not trust others when you are new

Answer

A

Question 23. What is ITA-2000?
(a) Information Technology Affairs – 2000
(b) Information Technology Amendments – 2000
(c) Indian Trading Acts – 2000
(d) Information Technology Act- 2000

Answer

D

Question 24. The property that is used to check whether a series is empty or not.
(a) nbytes
(b) empty
(c) none
(d) null

Answer

B

Question 25. Which property of a dataframe performs a transpose of a dataframe?
(a) shape
(b) T
(c) len
(d) ndim

Answer

B

Section B

Question 26. Given a Series:
flavours=pd.Series ([‘Vanilla’,‘Chocolate’,‘Butter’, ‘Coconut’],
index=[‘p’,‘q’,‘r’,‘s’])
print(flavours.loc[‘q’:‘r’])
Find the output of the above code.
(a) q Chocolate
      r Butter
(b) q Chocolate
(c) r Butter
(d) Empty set

Answer

A

Question 27. Given a Series “myseries” created as:
import pandas as pd
import ________ as np
myseries=pd.Series([30,40,_____,440,670])
print(myseries)
Output
0 30.0
1 40.0
2 NaN
3 440.0
4 670.0
What should be filled in the blanks to get the output?
(a) Numpy, NaN
(b) random,np.NaN
(c) numpy, np.NaN
(d) None of these

Answer

C

Question 28. Sunaina wanted to rearrange the contents of a DataFrame “scoredf” on the basis of indexes, the statement she has to write is
( The present order of indexes are (0,1,2,3,4) and the new order is to be (4,2,3,0,1))
(a) scoredf=scoredf.reindex([1,4,3,2,0])
(b) scoredf=scoredf.reindex([4,2,3,0,1])
(c) scoredf=scoredf.re_index([4,2,3,0,1])
(d) scoredf=scoredf.arrange_index([4,2,3,0,1])

Answer

B

Question 29. Stealing the creations done from ideas or minds , of others is
(a) piracy
(b) hacking
(c) plagiarism
(d) stalking

Answer

C

Question 30. Given the following plot , the code to plot the box at the top left corner showing lines for Science and Commerce is

Class 12 Informatics Practices Sample Paper Term 1 Set A

(a) import matplotlib.pyplot as p
p.box(“Science”,“Commerce”)
(b) import matplotlib.pyplot as p
p.show()
(c) import matplotlib.pyplot as p
p.legend()
(d) p.label()

Answer

C

Question 31. Statement A The function to provide a x-axis label is xlabel().
Statement B It is compulsory to provide a xlabel.
(a) Statement A is correct.
(b) Statement B is correct.
(c) Statement A is correct, Statement B is incorrect.
(d) Statement A is incorrect, Statement B is correct.

Answer

C

Question 32. A bar chart can be saved by the
(a) savebar() function
(b) savepic() function
(c) savechart() function
(d) savefig() function

Answer

D

Question 33. Encryption of passwords provides
(a) insecurity
(b) security
(c) compression
(d) backup

Answer

B

Question 34. Given the statements with respect to intrusion of computer viruses.
Statement A A computer virus can intrude from books.
Statement B A computer virus can intrude from radiation.
Statement C A computer virus can intrude from a pen drive.
Statement D A computer virus can intrude from the network.
(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

C

Question 35. Given the following code to create a Series as import pandas as mp
redSeries=mp.Series(100,index=range(100, 60,-15)) print(redSeries)
Find the output of above code.

Class 12 Informatics Practices Sample Paper Term 1 Set A
Answer

C

Question 36. Which of the following is/are true about a proprietary software?
(a) Available for free
(b) Can be freely copied
(c) Needs a license to be bought
(d) All of these

Answer

C

Question 37. The correct way to create an empty DataFrame is
(a) import pandas as p
     df=p.Dataframe()
(b) import pandas as p
     df=p.DataFrame()
(c) df=p.Dataframe(Empty)
(d) None of these

Answer

B

Question 38. The term digital footprints can also be referred as
(a) digital traces
(b) digital symbols
(c) digital tattoos
(d) None of these

Answer

C

Question 39. The index of a DataFrame starts by default from.
(a) 1
(b) 0
(c) 2
(d) ‘a’

Answer

B

Question 40. Given the code :
d={‘Name’:[‘Ram’,‘Shyam’,‘Sita’,‘Laxman’],‘Age’:[26,24,22,23],‘Score’:[85,63,55,74]}
Scoredf=pd.DataFrame(d,columns=[‘Name’,‘Age’,‘Score’])
Scoredf = Scoredf.rename(index={0:‘First Player’,1:‘Second Player’,2:‘Third Player’,3:‘Fourth Player’})
print(Scoredf)
What will be the output of the code?

Class 12 Informatics Practices Sample Paper Term 1 Set A
Answer

A

Question 41. Debarati was feeling health related problems for few days as she uses the digital gadgets excessively, which preventive measures would relax her
(a) talking to her friends
(b) having a balanced diet
(c) perform physical exercises regularly and apply water to her eyes periodically
(d) None of the above

Answer

C

Question 42. The keyword that includes a module in Python is
(a) imports
(b) include
(c) add
(d) import

Answer

D

Question 43. Given the Series waterseries prepared as:
waterdict={‘Plain’:20,‘Sweet’:50,‘Distilled’:100}
waterseries=p.Series(waterdict)
print(waterseries)
Output
Plain         20
Sweet       50
Distilled    100
The statement to give the following output is
Distilled 100
Plain 20
(a) waterseries[: :-1]
(b) waterseries[: :-2]
(c) waterseries[: : 0]
(d) waterseries[: :]

Answer

B

Question 44. Rama created a Series storing the names and prices of icecreams as follows : import pandas as pd
icecream=pd.Series([150,200,300],index=[‘Blackberry’,‘Blachforest’,‘Butter’])
She wants to display the icecream prices increased by 30 , a statement to do so is
(a) import pandas as pd
(b) import pandas as pd icecream+30 icecream=[30]
(c) import pandas as pd
(d) None of these icecream[price]=price+30

Answer

A

Question 45. Which of the following is not affected by computer viruses?
(a) Hard disk
(b) Network system
(c) SMPS
(d) Pen drives

Answer

C

Question 46. Given a dataframe ‘Roomdf’
Index      Rno      Rtype       Tariff
0             123        AC            3000
1             124       General    1000
2             125       Deluxe      4500

The command that displays the third row is
(a) Roomdf.iloc[2:]
(b) Roomdf.loc[2:]
(c) Roomdf[2:]
(d) All of these

Answer

D

Question 47. A Series ‘s’ is created as :
0   11
1   22
2   33
3   44
4   55
What will be the output of print(s[-3: : -1 ])?
(a) 2 33
     1 22
     0 11
(b) 1 22
     0 11
(c) 2 33
     0 11
(d) Error in code

Answer

A

Question 48. Given a dataframe “Proddf” carrying the following data of products:
Index    Prodid    Pname    Qty
0           1             Tea         25
1           2             Coffee     40
2           3             Snacks    50
The statement to display only the ‘Qty’ of all products is
(a) Proddf[,:,“Qty”]
(b) Proddf[“Qty”]
(c) Proddf[“Qty”,:]
(d) Proddf[:,“Qty”]

Answer

B

Question 49. Given statements about a series.
Statement A The values property prints the list of values from a Series.
Statement B It also prints the data type of the values.
(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

A

Section C

(Case Study Based Questions)

Mr. Krishnamurthy, who is a new user of Python Pandas , has created the following series “Electrical” carrying names of electrical appliances as values and their wattage as the index. He wants to perform certain operations on the series . You are supposed to help him in writing the commands.
Electrical
Index        Name
12W         LED
200W       Fan
1000W     Electric Iron
1200W     Rice Cooker

Question 50. He created another series “Electrical1” storing?
Index       Name
12W         Bulb
200W       Induction
What will be the output of Electrical + Electrical1?

Class 12 Informatics Practices Sample Paper Term 1 Set A
Answer

A

Question 51. He wants to display only the first two rows of “Electrical” , the statement that he should write is
(a) Electrical[0:3]
(b) Electrical[0:2]
(c) Electrical.loc[“12W”:”200W”]
(d) Both (b) and (c)

Answer

D

Question 52. The dimension of the series “Electrical” is given by
(a) Electrical.dimension
(b) Electrical.dim
(c) Electrical.ndim
(d) Electrical.bytes

Answer

C

Question 53. What will be the output of the statement?
Electrical[Electrical==“Fan”]
(a) 1 Fan
(b) 200W Fan
(c) Empty set
(d) Error

Answer

B

Question 54. He wants to change the index of Electrical series “LED” element to “A” ,the command will be:
(a) Electrical=Electrical.rename(index={‘12W’:“A”})
(b) Electrical=Electrical.ren(index={‘12W’:“A”})
(c) Electrical=Electrical.rename({‘12W’:“A”})
(d) Both (a) and (c)

Answer

A

Question 55. He wrote the statement:
del Electrical [“1000 W”]
print (Electrical)
What will be the output of the above statement?
(a) Index   Name
12W         LED
200W       Fan
1000W     Electric Iron
1200W     Rice Cooker
(b) Index   Name
12W          LED
200W         Fan
1200W       Rice Cooker
(c) Index    Name
12W           LED
200W          Fan
(d) None of the above

Answer

B