Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 4 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 4 with Solutions
Time Allowed: 3 hours
Maximum Marks: 70
General Instructions:
- This question paper contains five sections, Section A to E.
- All questions are compulsory.
- Section A have 18 questions carrying 01 mark each.
- Section B has 07 Very Short Answer type questions carrying 02 marks each.
- Section C has 05 Short Answer type questions carrying 03 marks each.
- Section D has 03 Long Answer type questions carrying 05 marks each.
- Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only,
- All programming questions are to be answered using Python Language only.
Section – A
Multiple Choice Questions
Question 1.
Pandas key data structure is called:
(A) Keyframe
(B) DataFrame
(C) Statistics
(D) Econometrics [1]
Answer:
(B) DataFrame
Explanation: Pandas is built on the Numpy package and its key data structure is called the DataFrame. [1]
Question 2.
Which command will be used to delete 3 and 5 rows of the data frame, assuming the data frame name as DF.
(A) DF.drop([2,4],axis=0)
(B) DF.drop([2,4],axis=l)
(C) DF.drop([3,5],axis=l)
(D) DF.drop([3,5]) [1]
Answer:
(A) DF.drop([2,4],axis=0)
Explanation: Drop( ) Method Parameters index – the list of rows to be deleted axis=0 – Marks the rows in the dataframe to be deleted inplace=True – Performs the drop operation in the same dataframe, rather than creating a new dataframe object during the delete operation [1]
Question 3.
AVhich object do you get after reading a CSV file using pandas.read_csv()?
(A) Dataframe
(B) Nd array
(C) Char Vector
(D) None [1]
Answer:
(D) None
Explanation: Pandas read_csv( ) method is used to read CSV file into DataFrame object. The CSV file is like a two-dimensional table where the values are separated using a delimiter. [1]
Question 4.
The now( )function in MySql is an example of
(A) Math function
(B) Text function
(C) Date Function
(D) Aggregate Function [1]
Answer:
(C) Date Function
Explanation: Date and time functions operate on a date and time input value and return a string, numeric, or date and time value. NOW(): Function in MySQL is used to check the current date and time value. The return type for NOW() function is either in ‘YYYY-MM-DD HH:MM:SS’ format or YYYYMMDDHHMMSS [1]
Question 5.
Which of the following is not a built in aggregate function in SQL?
(A) avg
(B) max
(C) total
(D) count [1]
Answer:
(C) total
Explanation: SQL does not include total as a built in aggregate function. The avg is used to find average, max is used to find the maximum and the count is used to count the number of values. [1]
Commonly Made Error:
Sometimes Students mix the aggregate functions with other functions.
Answering Tip:
Students should learn all functions with its syntax and examples.
Question 6.
Which of the following aggregation operation adds up all the values of the attribute?
(A) add
(B) avg
(C) max
(D) sum [1]
Answer:
(D) sum
Explanation: SQL SUM function is used to find out the sum of a field in various records. [1]
Question 7.
What is an standalone computer system ?
(A) It is a computer system with internet connectivity
(B) It is a server
(C) It is a computer without any networking
(D) None is correct [1]
Answer:
(C) It is a computer without any networking
Explanation: A desktop or laptop computer that is used on its own without requiring a connection to a local area network (LAN) or wide area network (WAN).When the computer is running local applications without Internet access, the machine is technically a stand-alone PC. [1]
Question 8.
A collection of hyperlinked documents on the internet forms the
(A) World Wide Web (WWW)
(B) E-mail system
(C) Mailing list
(D) Hypertext markup language [1]
Answer:
(A) World Wide Web (WWW)
Explanation: The World Wide Web (“WWW” or “The Web”) is the part of the Internet that contains websites and webpages. [1]
Question 9.
After practicals, Atharv left the computer laboratory but forgot to sign off from his email account. Later, his classmate Revaansh started using the same computer. He is now logged in as Atharv. He sends inflammatory email messages too few of his classmates using Atharvs email account. Revaansh activity is an example of which of the following cybercrime? Justify your answer.
(A) Hacking
(B) Identity theft
(C) Cyber bullying
(D) Plagiarism [1]
Answer:
(B) Identity theft
Explanation: Identity theft is the crime of obtaining the personal or financial information of another person to use their identity to commit fraud, such as making unauthorized transactions or purchases. [1]
Question 10.
A is someone who breaks into someone else’s computer system, often on a network; bypasses passwords or licenses in computer programs without malicious intent with a wish to learn and improve security.
(A) hacker
(B) cracker
(C) worm
(D) malware [1]
Answer:
(A) hacker
Explanation: A hacker is a person who breaks into a computer system and is an attempt to exploit a computer system or a private network inside a computer. [1]
Question 11.
The following can be patented
(A) Machine
(B) Process
(C) Composition of matter
(D) All of the above [1]
Answer:
(D) All of the above
Explanation: The three types of patents are utility patents, design patents, and plant patents. [1]
Question 12.
Abhilasha forgot to sign out from her gmail id and Aditi used Abhilasha’s gmail to sent mail. This act of Aditi is considered as:
(A) Plagiarism
(B) Identity Theft
(C) Phishing
(D) Piracy [1]
Answer:
(B) Identity Theft
Explanation: Identity theft refers to act as someone else to send some information/message or for some odd financial or personal gains. [1]
Question 13.
In which year India’s IT Act came into existence ?
(A) 2000
(B) 2001
(C) 2002
(D) 2003 [1]
Answer:
(A) 2000
Explanation: IT ACT is the primary law in India dealing with cybercrime and electronic commerce. [1]
Question 14.
SELECT MOD(12, 5); will produce the output as:
(A) 2
(B) 4
(C) 0
(D) 5 [1]
Answer:
(A) 2
Explanation: SQL MOD( ) function is used to get the remainder from a division. [1]
Question 15.
SELECT LEFT (‘Program’, 4); Output will be:
(A) gram
(B) Prog
(C) rogr
(D) Pro [1]
Answer:
(B) Prog
Explanation: LEFT( ) is used to return a specified number of characters from the left of the string. The number of characters returned is determined by the second argument. [1]
Question 16.
SELECT INSTR(‘Python Program’, ‘thon’); will produce the output:
(A) 3
(B) 4
(C) -2
(D) 2 [1]
Answer:
(A) 3
Explanation: The INSTRQ function returns the position of the first occurrence of a string in another string. This function performs a case-insensitive search. [1]
Assertion & Reason
Directions: In the following questions, a statement of assertion (A) is followed by a statement of reason (R). Mark the correct choice as:
(A) Both assertion (A) and reason (R) are true and reason (R) is the correct explanation of assertion (A).
(B) Both assertion (A) and reason (R) are true but reason (R) is NOT the correct explanation of assertion (A).
(C) Assertion (A) is true but reason (R) is false.
(D) Assertion (A) is false but reason (R) is true.
Question 17.
Assertion (A): VoIP stands for Voice over Internet Protocol.
Reason (R): It is a technology that allows you to make voice calls using a broadband internet connection instead of a regular phone line. [1]
Answer:
(A) Both assertion (A) and reason (R) are true and reason (R) is the correct explanation of assertion (A).
Explanation: A VoIP phone system is a technology to make phone calls through your internet connection instead of a regular landline or a mobile network. A
VoIP system converts analog voice signals into digital signals over your broadband connection. A VoIP server is used to connect calls to other telephone networks. [1]
Question 18.
Assertion (A): In Python Pandas, Series.index attribute is used to get or set the index labels of the given series object.
Reason (R): ix[ ] attribute is used to access a group of rows and columns by label (s) or a boolean array in the given series object. [1]
Answer:
(C) Assertion (A) is true but reason (R) is false.
Explanation: .loc[ ] attribute is used to access a group of rows and columns by label (s) or a boolean rray in the given series object.
.ix[ ] attribute is primarily label location based indexer, with integer position fallback. It takes the label as input and returns the value corresponding to that label. [1]
Section – B
Question 19.
What are the advantages of computer network?
OR
(i) I:
- am a small text file
- created on a user’s computer
- contain small pieces of data — like a username, password and user’s browsing history as well as preferences
- may help to improve user’s web browsing experience. Who am I?
(ii) Name any two popular web browsers.
Answer:
Advantages of computer network are as follows :
(i) Resource sharing: A network enables sharing of data files. Software can be installed on a central server instead of buying licenses for every machine. Peripherals such as printers, scanners can be shared across an organization. Databases and files can be shared. This reduces cost effectively.
(ii) Better communication: Internet enables better communication through e-mail, messaging, chat rooms and video conferencing.
(iii) Access to remote database: Internet allows users to access the remote databases like railway reservation, universities, hotels etc. [2]
OR
(i) Cookies
(ii) Two popular web browsers:
- Mozilla Firefox
- Google Chrome
Question 20.
What is the difference between HAVING and WHERE clauses? [2]
Answer:
Having Clause | Where Clause |
It is implemented in column operations. | It is implemented in row operations. |
It cannot be used without a select statement. | In can be used with select and other statements such as UPDATE, DELETE or either one of them. |
Question 21.
Consider the following SQL string: “Connection”
Write commands to display:
(a) “tion”
(b) “nec” [2]
Answer:
(a) SELECT MID (“Connection”, 7);
(b) SELECT SUBSTR(“Connection” ,4,3); [2]
Question 22.
Write a Python code to create dataframe with appropriate headings from the list given below :
[‘S101’, ‘Amy’, 70]
[‘S102’, ‘Bandhi’, 69]
[‘S104’, ‘Cathy’, 75]
[‘S105’, ‘Gundoho’, 82] [2]
Answer:
import pandas as pd
data = [[‘S101′, Amy’, 70], [‘S102’, ‘Bandhi’, 69], [‘S104, ‘Cathy’, 75], [‘S105’, ‘Gundoho’, 82]]
df=pd. DataFrame (data,columns = [‘ID’, ‘Name’, ‘Marks’])
print(df) [2]
Question 23.
What are digital rights?
OR [2]
Write the rules to follow for good netiquette.
Answer:
(i) Always take permission of other person before sharing their personal information, photos, etc: If you don’t take permission before sharing the information, it is bad netiquette.
(ii) Never make bad comments about anyone on social media it will degrade your reputation and don’t catch into fight on social media even try to avoid such situation.
(iii) Never post abusive content on social media, it will create difficulty for you. Even your account can be terminated. [2]
OR
Some Rules Of Netiquette:
(i) One of the core rules of netiquettes is thinking before typing. This includes getting people’s names right, not making negative remarks just because we can’t see the person reading them, and using correct emojis.
(ii) When chatting online, never ignore the other person’s messages or close the chat abruptly.
(iii) Another important netiquette rule for online etiquette is valuing other people’s privacy.
(iv) Do not use another person’s words, images or information without permission and citing the source.
(v) Avoid publishing or sharing unprofessional pictures with co-workers or your classmates.
(vi) If you are working from home, send work emails using your official email address.
(vii) Never forget to add a signature block at the end of official communication. [2]
Commonly Made Error:
Rights relating to digital resources are not welldefined.
Answering Tip:
Digital rights describe the human right in cyberworld.
Question 24.
Give the output of the following code:
import pandas as pd
data = [‘One’, ‘Two’, ‘Three’, ‘Four’,’Five’]
df = pd.DataFrame(data) [3]
print(df) [2]
Answer:
Output
0 | One |
1 | Two |
2 | Three |
3 | Four |
4 | Five |
[2]
Question 25.
How Pyplot is related to Matplotlib?
Answer:
Pyplot is a module in the Matplotlib package. That’s why we often see matplotlib.pyplot in code. The module provides an interface that allows you to implicitly and automatically create figure and axes to achieve the desired plot. [2]
Section – C
Question 26.
Consider the table ‘Teacher’ given below
Teacher_Id | Department | Periods |
T101 | Science | 32 |
T102 | Null | 30 |
T103 | Mathematics | 34 |
What will be the output of the following queries on the basis of the above table?
(i) Select count(Department) from Teacher;
(ii) Select count(*) from Teacher;
(iii) Select Department from Teacher order by Periods; [3]
Answer:
(i) 2
(ii) 3
(iii) NULL
SCIENCE
MATHEMATICS [3]
Question 27.
Consider two objects X and Y. X is a list where as Y is a Series. Both have values 15,20, 40,65,90. What will be the output of the following two statements considering that the above objects have been created already?
(a) print (X*3)
(b) print(Y*3)
Justify your answer. [3]
Answer:
(a) will give the output as:
[15, 20, 40, 65, 90, 15, 20, 40, 65, 90, 15, 20, 40, 65, 90]
(b) will give the output as
0 | 45 |
1 | 60 |
2 | 120 |
3 | 195 |
4 | 270 |
Question 28.
What is the output of the following code?
5potCrudePrices_2013_Data = {
‘U.K. Brent’ : {‘2013-Q1’ : 112.9, ‘2013-Q2’:103.0, ‘2013-Q3’ : 110.1, ‘2013-Q4’ :109.4},
‘Dubai’ : {‘2013-Q1’: 108-1, ‘2013-Q2’: 100.8, ‘2013-Q3’: 106.1, ‘2013-Q4’: 106.7},. ‘West Taxes Intermediate’ : {‘2013-Q1’ : 94.4, ‘2013-Q2’ : 94.2, ‘2013-Q3’ : 105.8, ‘2013-Q4’ : 97.4}}
Answer:
output
– | U.K. Brent | Dubai | West Taxes Intermediate |
2013-Q1 | 112.9 | 108.1 | 94.4 |
2013-Q2 | 103.0 | 100.8 | 94.2 |
2013-Q3 | 110.1 | 106.1 | 105.8 |
2013-Q4 | 109.4 | 106.7 | 97.4 |
Question 29.
Explain IPR.
OR
What is IT Act 2000?
Answer:
Intellectual Property Rights (IPR) are legal rights governing the use of creations of the human mind. The recognition and protection of these rights is of recent origin. Copyrights, Patents, designs and trademarks are considered as industrial property.
Intellectual Property Rights are one’s legal rights in respect of the ‘property’ created by one’s mind – such as an invention, or piece of music, or an artistic work, or a name or slogan or symbol, or a design, which is used in commerce, in the form of books, music, computer software, designs, technological know-how, trade symbols, etc. These rights are largely covered by the laws governing Patents, Trademarks, Copyright and Designs.
These various laws protect the holder of IP rights from third party encroachment of these rights. It also allows them to exercise various exclusive rights over their intellectual property. [3]
OR
The Parliament of India passed its first Cyber law on the 17th October 2000, the Information Technology (IT) Act, 2000, which provides the legal infrastructure for e-commerce in India.
The purpose of the IT Act, 2000, as mentioned in the language of the Act is:
to provide legal recognition for transaction carried out by means of electronic data interchange and other means of electronic communication, commonly referred to as ” electronic commerce”, which involves the use of alternative to paper based methods of communication and storage of information, to facilitate electronic filling of document with the Government agencies and further to amend the Indian Penal Code, the Indian Evidence Act,1872,
the Banker’s Book Evidence Act, 1891 and the Reserve Bank of India Act, 1934 and for matters connected therewith or incidental thereto. The General Assembly of the United Nations, by its resolution A/RES/51/162 dated 30th January 1997, adopted the Model Law on International Trade Law. [3]
Question 30.
Write the output of the following SQL queries: [3]
(i) SELECT MID(‘Communication’, 4,3);
(ii) SELECT INSTR(‘PROGRAM’, ‘ROG’);
(iii) SELECT RIGHT(‘Communication’, 4);
Considering the same string “Connection”
Write SQL commands to display:
(i) the position of the substring ‘nec’ in the string
(ii) the last 3 letters of the string
(iii) the length of the string
Answer:
(i) mun
(ii) 2
(iii) tion
[3]
OR
(i) SELECT INSTR (“Connection”, “nec”);
(ii) SELECT RIGHT( “Connection”, ,3);
(iii) SELECT LENGTH(“Connection”);
Section – D
Question 31.
Which function converts all the letters in a string into uppercase? Explain with example. [5]
OR
Consider the following tables Product and Client. Write SQL commands for the statements (i) to (iii) and give outputs for SQL queries (iv) to (v).
Table: PRODUCT
P_ID | Product Name | Manufacturer | Price |
TP01 | Talcum Powder | LAK | 40 |
FW05 | Face Wash | ABC | 45 |
BS01 | Bath Soap | ABC | 55 |
SH06 | Shampoo | XYZ | 120 |
FW12 | Face Wash | XYZ | 95 |
Table: CLIENT
C_ID | Client Name | City | P_ID |
01 | Cosmetic Shop | Delhi | FW05 |
06 | Total Health | Mumbai | BS01 |
12 | Live Life | Delhi | SH06 |
15 | Pretty Woman | Delhi | FW12 |
16 | Dreams | Bengaluru | TP01 |
Write SQL command
(i) To display the details of those Clients whose city is Delhi.
(ii) To display the details of Products whose Price is in the range of 50 to 100 (both values included).
(iii) To display the details of those products whose name ends with ‘Wash’
Give output of
(iv) Select distinct City from CLIENT;
(v) Select Manufacturer, max(Price), min(Price), count(*) from PRODUCT group by Manufacturer;
Answer:
UPPER function converts all the letters in a string into uppercase. If you want to convert a string to lowercase, you use the LOWER function instead.
The syntax of the UPPER function is as simple as below.
UPPER(string);
If the input string is NULL, the UPPER function returns NULL, otherwise, it returns a new string with all letters converted to uppercase.
Besides the UPPER function, some database systems provide you with an additional function named UCASE which is the same as the UPPER function. It is “there is more than one way to do it”.
UCASE(string);
SQL UPPER function examples
The following statement converts the string sql upper to SQL UPPER:
mysql> SELECT UPPER(‘sql upper’);
OUTPUT
OUTPUT |
SQL UPPER |
[5]
OR
(i) SELECT * FROM CLIENT WHERE City = “Delhi”;
(ii) SELECT * FROM PRODUCT WHERE PRICE BETWEEN 50 AND 100;
(iii) SELECT * FROM PRODUCT WHERE ProductName LIKE ‘\% wash’;
(iv)
Distinct City |
Delhi Mumbai Bengaluru |
(v)
Manufacturer | Max (Price) | Min (Price) | Count (*) |
LAK | 40 | 40 | 1 |
ABC | 55 | 45 | 2 |
XYZ | 120 | 95 | 2 |
Question 32.
ABC Pvt Ltd. is setting up the network in the Bengaluru. There are four departments named as market, Finance, Legal and Sales. [5]
Distance between various buildings is as follows :
Market to Finance | 80 mt |
Market to Legal | 180 mt |
Market to Sales | 100 mt |
Legal to Sakes | 150 mt |
Legal to Finance | 100 mt |
Finance to Sales | 50 ml |
Number of computers in the building:
Market | 20 |
Legal | 10 |
Finance | 08 |
Sales, | 42 |
(i) Suggest a cable layout of connections between the departments and specify the topology.
(ii) Suggest the most suitable building to place the server by giving suitable reason.
(iii) Suggest the placement of (i) modem (ii) hub/switch in the network.
(iv) The organization is planning to link its sale counter situated in various part of the same city. Which type of network out of LAN, WAN, MAN will be formed? Justify.
(v) The organisation also has inquiry office in another city about $50-60 \mathrm{~km}$ away in hilly region. Suggest the suitable transmission media to interconnect to its Market department and inquiry office out of the following: Fiber optic cable, Microwave, Radiowave
Answer:
(i) Mesh topology should be used.
(ii) Sales is the most suitable building to place the server because it has maximum number of computers.
(iii) Each building should have hub/switch and modem in case internal connection is required.
(iv) MAN (Metropolitan Area Network) as this network can be carried out in a city network.
(v) Radiowaves can be used in hilly regions as they can travel through obstacles. [5]
Question 33.
Write code to create Dataframe with following data. [5]
– | Colour | Count | Price |
Apple
Apple Pear Pear Lime |
Red
Green Red Green Red |
3
9 25 26 99 |
120
110 125 150 70 |
Now:
(i) Find all rows with the label ‘Apple’. Extract all columns.
(ii) List only rows with label ‘Apple’ and ‘Pear’ using loc.
OR
How can you add columns to a DataFrame?
Answer:
import pandas as pd
data =\{ ‘Colour’ : [Apple’ : ‘Red’, ‘Apple’ : ‘Green’, ‘Pear’ : ‘Red’, ‘Pear’ : ‘Green’, ‘Lime’ :’Red’],
‘Count’ : [‘Apple’ : 3, ‘Apple’ : 9, ‘Pear’ : 25, ‘Pear’ : 26, ‘Lime’ : 99],
‘Price’ : [‘Apple’ : 120, ‘Apple’ : 110, ‘Pear’ : 125, ‘Pear’ : 150, ‘lime’ : 70]\}
df=pd.DataFrame.from_dict(data)
(i) df.loc[‘Apple’, :]
(ii) df.loc[‘Apple’, ‘Pear’, :] [5]
OR
To add columns to a dataframe we can use either of the following methods:
Method 1: Declare the new list as column and adding it to the DataFrame. If df is a DataFrame object then we can declare list as.
Column_List = [‘a’, ‘b’, ‘c’, ‘d’]
df[‘New Column’] = Column_list.
A new column with label as New Column and elements as [‘a’, ‘b’, ‘c’, ‘d’] will be added to the Dataframe.
Method 2: using dataframe.insert( ). This function will add the column at the specified position.
e.g. if df is a Dataframe object then
df_insert(2, ‘New column’, Column_list)
Will add a column labelled New column at index position 2 with data as in column_list.
Method 3: using dataframe.assign( ). This function will add new column to the Dataframe and assign it to a new object.
e.g. df2=df.assign (New Column = [‘a’ , ‘b’ , ‘c’ , ‘d’])
A new Dataframe object df2 will be created with New column added to it
Section – E
Case based Subjective Questions
Question 34.
Consider the following table ‘Furniture’. Write output for (i) and (ii) and SQL command for (iii)
Table: Furniture
FCODE | NAME | PRICE | MANUFDATE | WCODE |
10023 | Coffee table | 4000 | 19-DEC-2016 | W03 |
10001 | Dining table | 20500 | 12-JAN-2017 | W01 |
10012 | Sofa | 35000 | 06-JUN-2016 | W02 |
10024 | Chair | 2500 | 07-APR-2017 | W03 |
10090 | Cabinet | 18000 | 31-MAR-2015 | W02 |
(i)SELECT SUM (PRICE) FROM Furniture WHERE WCODE=’ W03′; [1]
(ii) SELECT COUNT (DISTINCT PRICE) FROM Furniture; [1]
(iii) To display FCODE and NAME of each Furniture Item in descending order of FCODE. [2]
OR
To display WCODE wise, WCODE and the highest price of Furniture Items
Answer:
(i) SUM(PRICE) 6,500 [1]
(ii) COUNT (DISTINCT PRICE) 5 [1]
(iii) SELECT FCODE, NAME FROM Furniture ORDER BY FCODE DESC; [2]
OR
SELECT WCODE, MAX(PRICE) FROM Furniture GROUP BY WCODE;
Question 35.
Ms Ramdeep Kaur maintains the records of all students of her class. She wants to perform some operations on the data:
Code:
import pandas as pd
t= {‘Rollno’: [101,102,103,104,105,106,107],
‘Name’: [‘Shubrato’, ‘Krishna’, ‘Pranshu’,
‘Gurpreet’, ‘Arpit’, ‘Sanidhya’, ‘Aurobindo’],
‘Age’: [15,14,14,15,16,15,16],
‘parks’: [77.9, 70.4,60.9, 80.3,86.576,67.7,85.0],
‘Grade’: [’11B’, ’11A’, ’11B’, ’11C’, TIE’, ’11A’, ’11C’, ]}
df = pd.DataFrame (t,index=[10,20,30,40, 50,60,70])
print (df)
– | Rollno | Name | Age | Marks | Grade |
10 | 101 | Shubrato | 15 | 77.9 | 11B |
20 | 102 | Krishna | 14 | 70.4 | 11A |
30 | 103 | Pranshu | 14 | 60.9 | 11B |
40 | 104 | Gurpreet | 15 | 80.3 | 11C |
50 | 105 | Arpirt | 16 | 86.5 | 11E |
60 | 106 | Sanidhya | 15 | 67.7 | 11A |
70 | 107 | Aurobindo | 16 | 85.0 | 11C |
(a) (i) The correct statement for the below output: [1]
Name | Krishna |
Age | 14 |
Marks | 70.4 |
Grade | 11A |
(i) The teacher wants to know the marks secured by the second last student only, Which statement would help her to get the correct answer? [1]
(b) Which statement will add a new column ‘fee’ at second position with values [3200, 3400, 4500, 3100, 3200, 4000,3700] in Data frame df? [2]
OR (Option for part iii only)
Which command would rename the column ‘Marks’ to ‘Halfyearly’ in the DataFrame df?
Answer:
(i) (a) print(df.loc[20]) [1]
(b) print(df.loc[60:60,’Marks’]) [1]
(ii) df.insert(loc=2, column=’fee’, ‘value=[3200, 3400,4500,3100,3200,4000,3700]) [2]
OR
dfrename(columns={‘Marks’: ‘Halfyearly’},inplace =True)