KnowledgeBoat Logo
OPEN IN APP

Practice Paper

Practice Paper

Class 12 - Informatics Practices Preeti Arora



Section A (1 Mark Each)

Question 1

Computers connected by a network across different cities is an example of ............... .

  1. LAN
  2. MAN
  3. WAN
  4. PAN

Answer

MAN

Reason — Computers connected by a network across different cities is an example of MAN (Metropolitan Area Network).

Question 2

Out of the following, which crime(s) will come under the cybercrime category?

  1. Identity theft
  2. Invasion of privacy
  3. Online harassment
  4. All of these

Answer

All of these

Reason — The term cyber crime is a general term that covers crime like phishing, credit card frauds, illegal downloading, industrial espionage, child pornography, cyber bullying, cyber stalking, cyber terrorism, creation and/or distribution of viruses, spam and so on.

Question 3

E-waste is harmful to the environment and human health if not properly treated or disposed of, therefore, it must be handled with care. What are the health hazards which can be caused by E-waste?

  1. Lung cancer
  2. DNA damage
  3. Brain damage
  4. All of these

Answer

All of these

Reason — E-waste contains hazardous substances such as lead, mercury, cadmium, arsenic etc. Improper handling or disposal of e-waste can release these toxic substances into the environment, leading to various health hazards including lung cancer, DNA damage, and brain damage.

Question 4

What will be returned by the given query?

SELECT RIGHT("LEFT", 2) ; 

Answer

Output
+------------------+
| RIGHT("LEFT", 2) |
+------------------+
| FT               |
+------------------+
Explanation

The RIGHT() function in SQL extracts a specified number of characters from the right side of a string. The second parameter, 2, specifies that we want to extract 2 characters from the right end of the string "LEFT". Therefore, the result will be "FT".

Question 5

In the table 'Student' in MySQL, if column 'Fees' contains the data (5000, 8000, 7500, NULL, 5000, 8000), what will be the output after the execution of the given query?

SELECT COUNT(DISTINCT Fees) FROM student;

Answer

The above query will return 3 as the output.

Explanation

The query SELECT COUNT(DISTINCT Fees) FROM student; returns 3 because it counts the unique non-null values in the Fees column of the Student table. In the given data (5000, 8000, 7500, NULL, 5000, 8000), the distinct non-null values are 5000, 8000, and 7500. The NULL value is excluded from the distinct count, resulting in a count of 3.

Question 6

Online ............... is a theft of personal information in order to commit a fraud.

Answer

identity theft

Question 7

Identify the Single Row function of MySQL among the following:

  1. Trim ()
  2. Max ()
  3. Avg()
  4. Count()

Answer

Trim()

Reason — Trim() is a single row function that removes leading and trailing spaces from a string.

Question 8

What will be returned by the given query?

select round(23456.1234, -2) ;
  1. 23456.00
  2. 23400
  3. 23500
  4. 23456.1200

Answer

23500

Reason — The query SELECT ROUND(23456.1234, -2); will return 23500. This is because the ROUND() function in SQL rounds the number 23456.1234 to the nearest hundredth position specified by -2, resulting in 23500.

Question 9

Which one of the following functions is used to find the smallest value from the given data in MySQL?

  1. MIN()
  2. MINIMUM()
  3. SMALL()
  4. SMALLEST()

Answer

MIN()

Reason — The MIN() is an aggregate function in MySQL that returns the minimum value from a set of values.

Question 10

Choose the correct statement to print the label in the line chart.

  1. pl.xlabel("some values")
  2. pl.xlable("some values")
  3. pl.plotlabel("some values")
  4. None of these

Answer

pl.xlabel("some values")

Reason — In matplotlib, pl.xlabel("some values") is used to set the label for the x-axis of a plot.

Question 11

Which clause is used in the query to place the condition on group in MySQL?

  1. WHERE
  2. HAVING
  3. GROUP BY
  4. Both (i) and (ii)

Answer

HAVING

Reason — The HAVING clause is used in SQL queries to place conditions on groups when using the GROUP BY clause.

Question 12

Which of the following codes will display the total number of rows in the DataFrame stud?

  1. print (len(stud.axes[0]))
  2. print (stud.len(0) )
  3. print (stud.len [axes=0] )
  4. print (len (stud.axes[row] )

Answer

print(len(stud.axes[0]))

Reason — The command stud.axes[0] gives access to the index labels along the 0th axis (rows) of the DataFrame stud. The len(stud.axes[0]) returns the length of this index label array, which corresponds to the total number of rows in the DataFrame stud.

Question 13

The legal term to describe the rights of a creator of original creative or artistic work is−

  1. Copyright
  2. Copylef
  3. GPL
  4. FOSS

Answer

Copyright

Reason — A copyright is a legal term to describe the rights of the creator of an original creative work such as a literary work, an artistic work, a design, song, movie or software etc.

Question 14

In SQL, which clause is used to select specific rows?

Answer

In SQL, the WHERE clause is used to select specific rows based on certain conditions or criteria.

Question 15

Which is the device that connects dissimilar networks?

Answer

A gateway is a network device that connects dissimilar networks.

Question 16

Name the primary law in India dealing with cybercrime?

Answer

The primary law in India dealing with cybercrime is Information Technology Act, 2000.

Question 17

Assertion (A): A repeater is an electronic device that receives a signal and retransmits it.

Reasoning (R): Repeaters are used to extend transmissions so that the signal can cover longer distances.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Answer

Both A and R are true and R is the correct explanation of A.

Explanation
A repeater is an electronic device that receives a signal, amplifies it, and retransmits it. Repeaters are used to extend transmissions so that the signal can cover longer distances and overcome signal degradation that occurs over long distances.

Question 18

Assertion (A): In Series, values of data are Immutable: Value of elements cannot be changed.

Reasoning (R): Pandas Series are homogeneous one-dimensional objects, i.e., all data are of the same type.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Answer

A is false but R is true.

Explanation
In a Pandas Series, the values of data are mutable, meaning they can be changed. A Pandas Series is a one-dimensional structure with elements of homogeneous data types, which can include integers, strings, floats, or Python objects etc.

Section B (2 Marks Each)

Question 19(a)

How do computer networks reduce hardware costs of an organization? Explain with the help of an example.

Answer

Computer networks reduce hardware costs by enabling resource sharing and centralized management. For instance, shared printers and network storage reduce the need for multiple devices per user or department. Centralized management allows IT to monitor and maintain hardware from one location, reducing maintenance costs and improving efficiency. This approach minimizes the number of physical devices needed, lowers power consumption, and optimizes hardware utilization across the organization.

Question 19(b)

Distinguish between Static and Dynamic web pages.

Answer

Static web pagesDynamic web pages
In static web pages, the contents of the web pages remains fixed or unchanging. These web pages are loaded on the client's browser exactly in the same way as they are stored on the web server.A dynamic web page is created upon user request, displaying unique content based on interactions. Each view is tailored to the user and exist only for that moment.
A user can only read the information but cannot make any modifications or interact with the data.Dynamic web page is an Interactive web page that is highly functional and users can interact with it.
Static web pages are created by using only HTML.Dynamic web pages can be created by using ASP, PHP, or DHTML.

Question 20

Carefully observe the following code:

import pandas as pd
list_of_dict = [
{ 'Name' : 'Sourab' , 'Age' : 35, 'Marks' : 91}, 
{ 'Name' : 'Rohan', 'Age' : 31, 'Marks' : 87} ,
{ 'Name' : ' Shalini', 'Age' : 33, 'Marks' : 78}, 
{ 'Name' : ' Divya' , 'Age' : 23, 'Marks' : 93}
]
df = pd. DataFrame (list_of_dict) 
print (df)

Answer the following:

(i) List the index of the DataFrame df.

(ii) List the column names of DataFrame df.

Answer

(i) The index of the DataFrame df will be the default integer index range starting from 0 to the number of rows minus one. In this case, since df is created from a list of dictionaries, the index will be [0, 1, 2, 3].

(ii) The column names of DataFrame df is 'Name', 'Age', 'Marks'.

Question 21

What is the purpose of the DROP TABLE command in MySQL? How is it different from the DELETE command?

Answer

The DROP TABLE command in MySql is used to permanently delete an entire table from the database, including its structure, data, indexes, triggers, and constraints. The DELETE command, on the other hand, is used to remove specific rows or all rows from a table, leaving the table structure intact.

Question 22

Write Python code to create the following Series Stock (using list):

1 PEN
2 PENCIL
3 ERASER

Answer

import pandas as pd
items = ['PEN', 'PENCIL', 'ERASER']
Stock = pd.Series(items, index=[1, 2, 3])
print(Stock)
Output
1       PEN
2    PENCIL
3    ERASER
dtype: object

Question 23(a)

Ms. Samantha has many electronic gadgets which are not usable due to outdated hardware and software. Help her to find the three best ways to dispose of the used electronic gadgets.

Answer

The three ways to dispose of the used electronic gadgets are as follows:

  1. Recycling Centers and E-Waste Events
  2. Manufacturer Take-Back Programs
  3. Certified E-Waste Recyclers

Question 23(b)

What do you understand about Netiquette? Explain any two such etiquette.

Answer

Net Etiquettes refers to online manners while using Internet or working online. While online, we should be courteous, truthful and respectful of others.

The two netiquettes are as follows:

  1. Refrain from personal abuse — If we disagree to something, we may express robust disagreement, but never call them names or threaten them with personal violence.

  2. Never spam — We should not repeatedly post the same advertisement for products or services.

Question 24

Give the output:

import pandas as pd
name = ['Rahul','Aman','Karan']
p=pd.Series (name, index= [0,1,2] )
p1 = p.reindex ([1,2,3])
print(p)
print(p1)

Answer

Output
0    Rahul
1     Aman
2    Karan
dtype: object
1     Aman
2    Karan
3      NaN
dtype: object
Explanation

The provided Python code utilizes Pandas to create a Series p using the list name with indices [0, 1, 2]. Subsequently, p is reindexed using p.reindex([1, 2, 3]), creating a new Series p1. The output displays both p and p1.

Question 25

What is Mathematical function in SQL? Name any two.

Answer

In SQL, mathematical functions are built-in functions that perform mathematical operations on numeric data. POWER and SQRT are two examples of mathematical functions.

Section C (3 Marks Each)

Question 26

Mr. Sombuddha, an HR Manager in a multinational company "Star-X World", has created the following table to store the records of employees:

Table: Emp

EidENameDepartmentDOBDOJ
Star1DevSales1994-08-282020-02-14
Star2MelindaIT1997-10-152021-11-19
Star3RajAccounts1998-10-022019-04-02
Star4MichaelSales2000-02-172020-05-01
Star5SajalIT2001-12-052018-06-13
Star6JohnAccounts1995-01-032019-07-15
Star7JuliaSales1985-11-132020-08-19

Predict the output of the following queries that he has written:

(i) Select max(year(DOB)) from emp;

(ii) Select ENAME from emp where month(DOJ) = 11;

(iii) Select length(EName) from emp where Department = "IT";

Answer

(i)

Output
+----------------+
| max(year(DOB)) |
+----------------+
|           2001 |
+----------------+

(ii)

Output
+---------+
| ENAME   |
+---------+
| MELINDA |
+---------+

(iii)

Output
+---------------+
| length(EName) |
+---------------+
|             7 |
|             5 |
+---------------+

Question 27

Write a Python code to create a dataframe with appropriate headings from the list given below:

['S101', 'Amy', 70], ['S102', 'Bandhi', 69], ['S104', 'Cathy', 75], ['S105', 'Gundaho', 82]

Answer

import pandas as pd
data = [
    ['S101', 'Amy', 70],
    ['S102', 'Bandhi', 69],
    ['S104', 'Cathy', 75],
    ['S105', 'Gundaho', 82]
]
columns = ['ID', 'Name', 'Score']
df = pd.DataFrame(data, columns=columns)
print(df)
Output
     ID     Name  Score
0  S101      Amy     70
1  S102   Bandhi     69
2  S104    Cathy     75
3  S105  Gundaho     82

Question 28(a)

A relation Vehicles is given below:

V_noTypeCompanyPriceQty
AW125WagonRMaruti25000025
J0083JeepMahindra400000015
S9090SUVMitsubishi250000018
M0892Mini vanDatsun150000026
W9760SUVMaruti250000018
R2409Mini vanMahindra35000015

Write SQL commands to:

(i) Display the average price of each type of vehicle having a quantity of more than 20.

(ii) Count the type of vehicles manufactured by each company.

(iii) Display the total price of all types of vehicles.

Answer

(i)

SELECT Type, AVG(Price) AS Average_Price
FROM Vehicles
WHERE Qty > 20
GROUP BY Type;
Output
+----------+---------------+
| Type     | Average_Price |
+----------+---------------+
| WagonR   |   250000.0000 |
| Mini van |  1500000.0000 |
+----------+---------------+

(ii)

SELECT Company, COUNT(DISTINCT Type) AS Num_Vehicle_Types
FROM Vehicles
GROUP BY Company;
Output

+------------+-------------------+
| Company    | Num_Vehicle_Types |
+------------+-------------------+
| Datsun     |                 1 |
| Mahindra   |                 2 |
| Maruti     |                 2 |
| Mitsubishi |                 1 |
+------------+-------------------+

(iii)

SELECT SUM(Price * Qty) AS Total_Price
FROM Vehicles;
Output
+-------------+
| Total_Price |
+-------------+
|   200500000 |
+-------------+

Question 28(b)

What is the difference between the order by and group by clauses when used along with a select statement? Explain with an example.

Answer

ORDER BY:

The ORDER BY clause is used to sort the result set in ascending or descending order based on one or more columns.

Example:

SELECT *
FROM Vehicles
ORDER BY Price ASC;

This query selects all columns (*) from the Vehicles table and sorts the result set in ascending order (ASC) based on the Price column. The output will display the vehicles with the lowest price first.

GROUP BY:

The GROUP BY clause is used to group the result set based on one or more columns. It divides the result set into groups, and each group contains rows with the same values in the specified columns.

Example:

SELECT Type, AVG(Price) AS Average_Price
FROM Vehicles
GROUP BY Type;

This query selects the Type column and calculates the average price (AVG(Price)) for each group of vehicles with the same Type. The result set will display the average price for each type of vehicle.

Question 29(a)

Prerna received an email from her bank stating that there is a problem with her account. The email provides instructions and a link, by clicking on which she can log in to her account and fix the problem. Help Prerna by telling her the precautions she should take when she receives these types of emails.

Answer

When Prerna receives an email from her bank stating that there is a problem with her account, she should be cautious to avoid falling prey to phishing scams. She should check the sender's email address to ensure it's legitimate, avoid clicking on any links provided in the email, and instead manually type in the bank's website address in her browser. She should contact the bank directly using the phone number or email address listed on the bank's official website, and check for signs of phishing such as poor grammar or a sense of urgency. Additionally, she should never share personal information such as her username, password, or account number in response to an email, and keep her computer and antivirus software up-to-date to protect against malware and other security threats.

Question 29(b)

Write the names of any two common types of Intellectual Property Rights which are protected by law.

Answer

The two common types of Intellectual Property Rights that are protected by law are:

  1. Copyright
  2. Patent

Question 30

Consider the dataframe SHOP given below:

        Item     Qty    City     Price
101   Biscuit    100   Delhi       10
102   Jam        110   Kolkata     25
103   Coffee     200   Kolkata     55
104   Sauce       56   Mumbai      55
105   Chocolate  170   Delhi       25

Write commands to:

(i) Write short code to show the information having city = "Delhi".

(ii) Calculate Qty * Price and assign to column 'Net_Price'.

(iii) Display Items of all rows.

Answer

(i)

info = SHOP[SHOP['City'] == 'Delhi']
print(info)
Output
          Item  Qty   City  Price
101    Biscuit  100  Delhi     10
105  Chocolate  170  Delhi     25

(ii)

SHOP['Net_Price'] = SHOP['Qty'] * SHOP['Price']
print(SHOP)
Output
          Item  Qty     City  Price  Net_Price
101    Biscuit  100    Delhi     10       1000
102        Jam  110  Kolkata     25       2750
103     Coffee  200  Kolkata     55      11000
104      Sauce   56   Mumbai     55       3080
105  Chocolate  170    Delhi     25       4250

(iii)

items = SHOP['Item']
print(items)
Output
101      Biscuit
102          Jam
103       Coffee
104        Sauce
105    Chocolate
Name: Item, dtype: object

Section D (4 Marks Each)

Question 31

Consider the following table named "Student":

RollNoNameMarksGradeFeesStream
1Mishra30C6000Commerce
2Gupta48B15000Arts
3Khan66A4800Science
4Chaddha24C12500Commerce
5Yadav23A10000Arts

Write the SQL functions which will perform the following operations:

(i) To show the sum of fees of all students.

(ii) To display maximum and minimum marks.

(iii) To count different types of grades available.

(iv) Write a query to count grade-wise total number of students.

Answer

(i)

SELECT SUM(Fees) AS Total_Fees 
FROM Student;
Output
+------------+
| Total_Fees |
+------------+
|      48300 |
+------------+

(ii)

SELECT MAX(Marks) AS Max_Marks, MIN(Marks) AS Min_Marks 
FROM Student;
Output
+-----------+-----------+
| Max_Marks | Min_Marks |
+-----------+-----------+
|        66 |        23 |
+-----------+-----------+

(iii)

SELECT COUNT(DISTINCT Grade) AS Different_Grades 
FROM Student;
Output
+------------------+
| Different_Grades |
+------------------+
|                3 |
+------------------+

(iv)

SELECT Grade, COUNT(*) AS Total_Students 
FROM Student
GROUP BY Grade;
Output
+-------+----------------+
| Grade | Total_Students |
+-------+----------------+
| C     |              2 |
| B     |              1 |
| A     |              2 |
+-------+----------------+

Question 32

(i) Consider the dataframe "EMP":

        Name    Basic  Da   Hra
E1      Sanya   9500  3000  2000
E2      Krish   7000  5000  1900
E3      Rishav  9650  1500  2100
E4      Deepak  7500  2000  2700
E5      Kriti   9200  1800   500

Give the output

EMP.iloc[1, 2]=8000
EMP.Hra = EMP.Hra + 200
print(EMP)

(ii) Write a Python statement to change the name 'Rishav' to 'Rishab' in the above dataframe.

Or

(Option for part ii only)

Write a Python statement to calculate the sum of Basic, Da, and Hra and assign it to the column 'Salary'.

Answer

Output
      Name  Basic    Da   Hra
E1   Sanya   9500  3000  2200
E2   Krish   7000  8000  2100
E3  Rishav   9650  1500  2300
E4  Deepak   7500  2000  2900
E5   Kriti   9200  1800   700

(ii)

EMP.loc[EMP['Name'] == 'Rishav', 'Name'] = 'Rishab'

Or

(Option for part ii only)

EMP['Salary'] = EMP['Basic'] + EMP['Da'] + EMP['Hra']
Output
      Name  Basic    Da   Hra  Salary
E1   Sanya   9500  3000  2200   14700
E2   Krish   7000  8000  2100   17100
E3  Rishab   9650  1500  2300   13450
E4  Deepak   7500  2000  2900   12400
E5   Kriti   9200  1800   700   11700

Section E (5 Marks Each)

Question 33(a)

Consider the following table named "GARMENT".

GCODEGNAMESIZECOLOURPRICE
111T-ShirtXLRed1400.234
112JeansLBlue1600.123
113SkirtMBlack1100.65
115TrousersLBrown1500.50
116Ladies TopLPink1200.25

Write SQL queries using SQL functions to perform the following operations:

(i) Display the name and price after rounding off to one decimal place.

(ii) Display all Gname in upper case.

(iii) Display the last three characters from Gname.

(iv) Display the highest Gcode from the table GARMENT.

(v) Display the sum of all prices of size 'L'.

Answer

(i)

SELECT GNAME, ROUND(PRICE, 1) AS ROUNDED_PRICE
FROM GARMENT;
Output
+------------+---------------+
| GNAME      | ROUNDED_PRICE |
+------------+---------------+
| T-Shirt    |        1400.2 |
| Jeans      |        1600.1 |
| Skirt      |        1100.7 |
| Trousers   |        1500.5 |
| Ladies Top |        1200.3 |
+------------+---------------+

(ii)

SELECT UPPER(GNAME) AS GNAME_UPPERCASE
FROM GARMENT;
Output
+-----------------+
| GNAME_UPPERCASE |
+-----------------+
| T-SHIRT         |
| JEANS           |
| SKIRT           |
| TROUSERS        |
| LADIES TOP      |
+-----------------+

(iii)

SELECT RIGHT(GNAME, 3) AS LAST_THREE_CHARACTERS
FROM GARMENT;
Output
+-----------------------+
| LAST_THREE_CHARACTERS |
+-----------------------+
| irt                   |
| ans                   |
| irt                   |
| ers                   |
| Top                   |
+-----------------------+

(iv)

SELECT MAX(GCODE) AS HIGHEST_GCODE
FROM GARMENT;
Output
+---------------+
| HIGHEST_GCODE |
+---------------+
|           116 |
+---------------+

(v)

SELECT SUM(PRICE) AS TOTAL_PRICE_SIZE_L
FROM GARMENT
WHERE SIZE = 'L';
Output
+--------------------+
| TOTAL_PRICE_SIZE_L |
+--------------------+
|           4300.873 |
+--------------------+

Question 33(b)

Write the SQL functions which will perform the following operations:

(i) To return the summation of all non-NULL values of a data set.

(ii) To extract a substring starting from a position with a specific length.

(iii) To convert a string to uppercase.

(iv) To return the year for a specified date.

(v) To round off a number to a specified number of decimal places.

Answer

(i)

SELECT SUM(column_name) 
FROM table_name;

(ii)

SELECT SUBSTRING(column_name, start_position, length) 
FROM table_name;

(iii)

SELECT UPPER(column_name) 
FROM table_name;

(iv)

SELECT YEAR(date_column) 
FROM table_name;

(v)

SELECT ROUND(column_name, decimal_places) 
FROM table_name;

Question 34

A company in Mega Enterprises has 4 wings of buildings as shown in the diagram:

A company in Mega Enterprises has 4 wings of buildings as shown in the diagram: Societal Impacts, Informatics Practices Preeti Arora Solutions CBSE Class 12

Centre-to-centre distances between various buildings:

W3 to W1 — 50m
W1 to W2 — 60m
W2 to W4 — 25m
W4 to W3 — 170m
W3 to W2 — 125m
W1 to W4 — 90m

Number of computers in each of the wings:

W1 — 150
W2 — 15
W3 — 15
W4 — 25

Computers in each wing are networked but the wings are not networked. The company has now decided to connect the wings also.

(i) Suggest the most suitable cable layout for the above connections.

(ii) Suggest the most appropriate topology of the connection between the wings.

(iii) The company wants internet accessibility in all the wings. Suggest a suitable technology.

(iv) Suggest the placement of the repeater with justification.

(v) Suggest the placement of the Hub/Switch with justification if the company wants to minimize network traffic.

Answer

(i) A possible cable layout that connects all buildings with the minimum total distance could be: W3 → W1 → W2 → W4 as shown below:

A company in Mega Enterprises has 4 wings of buildings as shown in the diagram: Societal Impacts, Informatics Practices Preeti Arora Solutions CBSE Class 12

(ii) Bus topology is the most appropriate topology for connecting the wings.

(iii) The company should setup an internet proxy server in wing W1. Computers of all the other wings will access the internet through this proxy server.

(iv) A repeater should be placed between W4 and W3, and another one between W3 and W2 to ensure signal strength is maintained over these longer distances.

(v) To minimize network traffic and ensure efficient data handling, the hub/switch should be placed in all wings.

Question 35(a)

Write Python code to draw the following Bar graph representing the number of students in each class.

Write Python code to draw the following Bar graph representing the number of students in each class. Societal Impacts, Informatics Practices Preeti Arora Solutions CBSE Class 12

Answer

import matplotlib.pyplot as plt
x = ['IX', 'X', 'XI', 'XII']
y = [40, 45, 35, 45]
plt.bar(x, y)
plt.show()
Output
Write Python code to draw the following Bar graph representing the number of students in each class. Societal Impacts, Informatics Practices Preeti Arora Solutions CBSE Class 12

Question 35(b)

Write Python code to create a Line graph using the list of elements x and y. Set ylabel as "marks" and xlabel as "names". The title of the graph is 'Result'.

x = ['A', 'B', 'C', 'D', 'E']
y = [82, 25, 87, 14, 90]

Answer

import matplotlib.pyplot as plt
x = ['A', 'B', 'C', 'D', 'E']
y = [82, 25, 87, 14, 90]
plt.plot(x, y, marker='o')
plt.xlabel('names')
plt.ylabel('marks')
plt.title('Result')
plt.show()
Output
Write Python code to create a Line graph using the list of elements x and y. Set ylabel as marks and xlabel as names. The title of the graph is 'Result'. Societal Impacts, Informatics Practices Preeti Arora Solutions CBSE Class 12
PrevNext