Class 12 Informatics Practices Sample Paper Term 1 With Solutions Set A

Sample Papers for Class 12

Question. The name “Pandas” is derived from the term
(a) Panel Data
(b) Panel Series
(c) Python Document
(d) Panel Data Frame

Answer

A

Question. The command to install the pandas is
(a) install pip pandas
(b) install pandas
(c) pip pandas
(d) pip install pandas

Answer

D

Question. Python Pandas was developed by
(a) Guido Van Rossum
(b) Travis Oliphant
(c) Wes McKinney
(d) Brendan Eich

Answer

C

Question. Pandas series is
(a) two dimensional
(b) three dimensional
(c) one dimensional
(d) multi-dimensional

Answer

C

Question. Pandas is a
(a) package
(b) language
(c) library
(d) software

Answer

C

Question. We can analyse the data in Pandas with
(a) series
(b) dataframe
(c) Both (a) and (b)
(d) None of these

Answer

C

Question. Out of the following, which function cannot be used for customization of charts in Python?
(a) xlabel()
(b) color()
(c) title()
(d) xticks()

Answer

B

Question. What is the minimum number of arguments required for plot() function in matplotlib?
(a) 1
(b) 2
(c) 3
(d) 4

Answer

A

Question. Method or function to add a new row in a dataframe is
(a) .loc()
(b) .iloc()
(c) join()
(d) add()

Answer

A

Question. ……………. is the function to save the graph.
(a) savefig()
(b) savefigure()
(c) savegraph()
(d) savechart()

Answer

A

Question. A/An ………… 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

Answer

B

Question. Which of the following is not a type of cyber crime?
(a) Data theft
(b) Forgery of online documents
(c) Damage to data and systems
(d) Installing antivirus for protection

Answer

D

Question. ‘F’ in FOSS stands for
(a) Free
(b) Forever
(c) Fire
(d) Freezing

Answer

A

Question. Which of the following import statement is not correct?
(a) import pandas as class12
(b) import pandas as 1pd
(c) import pandas as pd1
(d) import pandas as pd

Answer

B

Question. IPR stands for
(a) Intelligent Property Rights
(b) Intellectual Property Reserve
(c) Intellectual Property Rights
(d) Intellectual Product Rights

Answer

C

Question. Which of the following is not a violation of IPR?
(a) Plagiarism
(b) Copyright infringement
(c) Patent
(d) Trademark infringement

Answer

C

Question. While accessing the column from the dataframe, we can specify the column name. In case column does not exist, which type of error it will raise?
(a) Key Error
(b) Syntax Error
(c) Name Error
(d) Runtime Error

Answer

A

Question. …………… is the practice of taking someone else’s work or ideas and passing them off as one’s own.
(a) Plagiarism
(b) Copyright
(c) Patent
(d) All of these

Answer

A

Question. Function to display the first n rows in the DataFrame is
(a) tail (n)
(b) head (n)
(c) top (n)
(d) first (n)

Answer

B

Question. Following are the impact of e-Waste on the environment.
Choose the odd one out.
(a) Soil pollution
(b) Water pollution
(c) Air pollution
(d) Sound pollution

Answer

D

Question. Abdul deleted all his chats from all his social media accounts and he thinks that all his traces are deleted completely. Is he right in thinking so?
(a) Yes
(b) No
(c) May be
(d) Not sure

Answer

B

Question. The legal and regulatory aspects of the internet refer to …………………
(a) cyber space
(b) cyber crime
(c) criminal law
(d) IT Act

Answer

D

Question. Pandas dataframe cannot be created using
(a) dictionary of tuples
(b) series
(c) dictionary of list
(d) list of dictionaries

Answer

A

Question. Which function will be used to read data from a CSV file into Pandas dataframe?
(a) readcsv()
(b) to_csv()
(c) read_csv()
(d) csv_read()

Answer

C

Question. Which of the following is not an attribute of Pandas dataframe?
(a) length
(b) T
(c) size
(d) shape

Answer

A

Question. What will be the output of the given code? import pandas as pds = pd.Series([1,2,3,4,5],
index=[‘akram’,‘brijesh’,‘charu’,‘deepika’,‘era’])
print(s[‘charu’])
(a) 1
(b) 2
(c) 3
(d) 4

Answer

C

Question. Assuming the given series, named stud, which command will be used to print 5 as output?
Amit           90
Ramesh     100
Mahesh      50
John           67
Abdul         89
Name: Student, dtype: int64
(a) stud.index
(b) stud.length
(c) stud.values
(d) stud.size

Answer

D

Question. A social science teacher wants to use a Pandas series to teach about Indian historical monuments and its states. The series should have the monument names as values and
state names as indexes which are stored in the given lists, as shown in the code.
import pandas as pd
Monument=[‘Qutub Minar’,‘Gateway of India’,‘Red Fort’,‘Taj Mahal’]
State=[‘Delhi’,‘Maharashtra’,‘Delhi’,‘Uttar Pradesh’]
Choose the statement, which will create the series.
(a) S=df.Series(Monument,index=State)
(b) S=pd.Series(State,Monument)
(c) S=pd.Series(Monument,index=State)
(d) S=pd.series(Monument,index=State)

Answer

C

Question. …………. is a cyber crime in which a target or targets are contacted by E-mail, telephone or text message by someone posing as a legitimate institution to lure individuals into providing sensitive data such as personally identifiable information, banking and credit card details and passwords.
(a) Plagiarism
(b) Phishing
(c) Cyber stalking
(d) Hacking

Answer

B

Question. Observe the following figure. Identify the code for obtaining this as output.

Class 12 Informatics Practices Sample Paper Term 1 With Solutions Set A

(a) import matplotlib.pyplot as plt
plt.plot([1,2],[4,5])
plt.show()
(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],[5,1])
plt.show()
(d) import matplotlib.pyplot as plt
plt.plot([1,3],[4,1])
plt.show()

Answer

B

Question. Read the statements given below and identify the right option to draw a histogram.
Statement A To make a histogram with matplotlib, we can use the plt.hist() function.
Statement B The bins 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.

Answer

C

Question. Which graph should be used where each column represents a range of values and the height of a column corresponds to how many values are in that range?
(a) plot
(b) line
(c) bar
(d) histogram

Answer

D

Question. Suhhani is confused about the free operating system available in the market. Few of her friends suggested a few operating systems. Help her in choosing free operating system for her device.
(a) Ubuntu
(b) Windows
(c) Mozilla Firefox
(d) Blender

Answer

A

Question. Consider the following statements with reference to the use of E-mail:
Statement A Sending threatening messages to a classmate.
Statement B Inviting friends to participate in a school club or sports activity.
Statement C Asking your teacher for help on homework.
Statement D Responding to or forwarding spam E-mails.
Which of the above statements refer to appropriate use of E-mail?
(a) Statements A and B
(b) Statements B and C
(c) Statements C and D
(d) Statements B and D

Answer

B

Question. Consider the following series named animal:
L    Lion
B    Bear
E    Elephant
T    Tiger
W   Wolf
dtype : object
Write the output of the command.
print(animal[::-3])
(a) L        Lion
     T        Tiger
    dtype: object
(b) B         Bear
     E         Elephant
     dtype: object
(c) W       Wolf
      B       Bear
     dtype: object
(d) W       Wolf
     T        Tiger
    dtype: object

Answer

C

Question. Saharsh is a student of Class IXth and he is a very frequent user of internet applications. One day he got an unpleasant message on his instant messenger. What do you think he should do?
(a) Ignore it and start chatting to someone else.
(b) Reply back to them and find out what their problem is.
(c) Shut down the computer and hope they’ll leave him alone in future.
(d) Go to his parents, teacher or other trusted adult and let them know that he feels uncomfortable.

Answer

D

Question. What is a correct syntax to return the values of first row of a Pandas DataFrame?
Assuming the name of the DataFrame is dfRent.
(a) dfRent[0]
(b) dfRent.loc[1]
(c) dfRent.loc[0]
(d) dfRent.iloc[1]

Answer

C

Question. Feasible method(s) to manage e-Waste.
(a) Reducing
(b) Reusing
(c) Recycling
(d) All of these

Answer

D

Question. What is the difference between loc() and iloc()?
(a) Both are label indexed based functions.
(b) Both are integer position based functions.
(c) loc() is label based function and iloc() integer position based function.
(d) loc() is integer position based function and iloc() index position based function.

Answer

C

Question. Write the output of the given code.
import pandas as pd
S1=pd.Series([5,6,7,8,10],index=[‘v’,‘w’,‘x’,‘y’,‘z’])
l=[2,6,1,4,6]
S2=pd.Series(l,index=[‘z’,‘y’,‘a’,‘w’,‘v’])
print(S1-S2)

Class 12 Informatics Practices Sample Paper Term 1 With Solutions Set A
Answer

B

Question. We should exhibit proper manners and etiquettes while being online. Choose the right netiquette(s).
(a) Avoid cyber bullying
(b) Respect other’s privacy
(c) No copyright violation
(d) All of these

Answer

D

Question. Which command will be used to delete 3 and 5 rows of the dataframe. Assuming the dataframe name as DF.
(a) DF.drop([2,4],axis=0)
(b) DF.drop([2,4],axis=1)
(c) DF.drop([3,5],axis=1)
(d) DF.drop([3,5])

Answer

A

Question. Write the output of the given code.
import pandas as pd
s=pd.Series([1,2,3,4,5,6],index=[‘A’,‘B’,‘C’,‘D’,‘E’,‘F’])
print(s[s%2==0])
(a) B 0
     D 0
     F 0
dtype: int64
(b) A 1
     B 2
     C 5
dtype: int64
(c) B 2
     D 4
     F 6
dtype: int64
(d) B 1
     D 2
     F 3
dtype: int64

Answer

C

Question. Ritika is a new learner for the Python pandas and she is aware of some concepts of Python. She has created some lists, but is unable to create the dataframe from the same.
Help her by identifying the statement which will create the dataframe.
import pandas as pd
Name=[‘Manpreet’,‘Kavil’,‘Manu’,‘Ria’]
Phy=[70,60,76,89]
Chem=[30,70,50,65]
(a) df=pd.DataFrame({“Name”:Name,“Phy”:Phy,“Chem“”:Chem})
(b) d=(“Name”:Name,“Phy”:Phy,“Chem”:Chem) df=pd.DataFrame(d)
(c) df=pd.DataFrame([Name,Phy,Chem],columns=[‘Name’,“Phy”,“Chem”,“Total”])
(d) df=pd.DataFrame({Name:“Name”, Phy :“Phy”,Chem: “Chem”})

Answer

A

Question. Linux, MySQL and Mozilla Firefox software come under……… category.
(a) proprietary
(b) FOSS
(c) freeware
(d) shareware

Answer

B

Question. Assuming the given structure, which command will give us the given output:

Class 12 Informatics Practices Sample Paper Term 1 With Solutions Set A

Output Required: (3,5)
(a) print(df.shape())
(b) print(df.shape)
(c) print(df.size)
(d) print(df.size())

Answer

B

Question. Consider the following dataframe df

Class 12 Informatics Practices Sample Paper Term 1 With Solutions Set A

Write the output of the given command:
df1.loc[:0,‘Sal’]
(a) 0 Kavita 50000 3000
(b) 50000
(c) 3000
(d) 55000

Answer

B

Question. Consider the following dataframe df:

Class 12 Informatics Practices Sample Paper Term 1 With Solutions Set A

Write the output of the given command:
print(df.Marks/2)

Class 12 Informatics Practices Sample Paper Term 1 With Solutions Set A
Answer

A

Question. Read the statements given below. Identify the right option from the following for attribute and method/function.
Statement A Attribute always ends without parenthesis.
Statement B Function/Method cannot work without arguments.
(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

C

Section C

(Case Study Based Questions)

This section consists of 6 questions (50 to 55). Attempt any 5 questions.

Mr. Sharma is working with an IT company and he has provided some data. On which he wants to do some operations, but he is facing some problem, help him:
import pandas as pd
ResultSheet={‘Naveen’: pd.Series([90, 91, 97],
index=[‘Maths’,‘Science’,‘Hindi’]),
‘Rehana’: pd.Series([92, 81, 96],
index=[‘Maths’,‘Science’,‘Hindi’]),
‘John’: pd.Series([89, 91, 88],
index=[‘Maths’,‘Science’,‘Hindi’]),
‘Roja’: pd.Series([81, 71, 67],
index=[‘Maths’,‘Science’,‘Hindi’]),
‘Mannat’: pd.Series([94, 95, 99],
index=[‘Maths’,‘Science’,‘Hindi’])}
DF = pd.DataFrame(ResultSheet)
print(DF)
Output of the above code:

Class 12 Informatics Practices Sample Paper Term 1 With Solutions Set A

Based on the given code, answer the questions No. 50 to 55.

Question. He wants to add a new column with name of student ‘Prem’ in above dataframe,choose the right command to do so.
(a) DF[‘Prem’]=[89,78,76]
(b) df[‘Prem’]=[89,78,76]
(c) DF[‘Prem’]=[89,78,76,67]
(d) DF[‘Name’]=[89,78,76]

Answer

A

Question. He wants to set all the values to zero in dataframe, choose the right command to do so.
(a) DF=0
(b) DF[]=0
(c) DF[:]=0
(d) DF[:]==0

Answer

C

Question. He wants to delete the row of science marks, choose the right command to do so.
(a) DF.drop(‘Science’, axis=1)
(b) DF.drop(‘Science’, axis=0)
(c) DF.drop(‘Science’, axis=-1)
(d) DF.drop(‘Science’, axis==0)

Answer

B

Question. The following code is to create another dataframe, which he wants to add to the existing dataframe. Choose the right command to do so.
Sheet1={‘Aaradhya’: pd.Series([90, 91,97],
index=[‘Maths’,‘Science’,‘Hindi’])}
S1=pd.DataFrame(Sheet1)
(a) DF.append(S1,axis=0)
(b) DF.append(S1)
(c) DF.insert(S1)
(d) DF.join(S1)

Answer

B

Question. What will be the output of the given command?
DF.index=[‘A’,‘B’,‘C’]

Class 12 Informatics Practices Sample Paper Term 1 With Solutions Set A

(d) Error, index already exists and cannot be overwritten

Answer

B

Question. What will be the output of the given command?
print(DF.size)

Class 12 Informatics Practices Sample Paper Term 1 With Solutions Set A

(a) 15
(b) 18
(c) 21
(d) 23

Answer

A