100% found this document useful (1 vote)
3K views9 pages

AI Practical File Part 1

Uploaded by

pujag2390
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
3K views9 pages

AI Practical File Part 1

Uploaded by

pujag2390
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

CLASS X

Artificial Intelligence Practical File

ADVANCE PYTHON

13. Write a program to generate the following pattern:

2 3

4 5 6

7 8 9 10

11 12 13 14 15

Code:

Output:

14. Write a program to create a list of students’ marks with user defined values and find the maximum

Code:
Output:

15. Write a program to create a list of numbers and swap the content with the next value if it is
divisible by 5.

For example: list = [4,25,31,7,35,44,55]

Output = [25,4,31,35,7,55,4]

Code:

Output:
16. Write a program to count the frequency of every element in a given list.

Code:

Output:
DATA SCIENCE

17. Write a program to create a 2D array using NumPy.

Code:

Output:

18. Write a program to convert a python list to a NumPy array

Code:

Output:
19. Write a program to develop a matrix of 3x3 with values from 11 to 28

Code:

Output:

20. Write a program to create a data frame to store data of candidates who appeared in interviews.
The data frame columns are name, score, attempts and qualify (Yes/No). Assign row index as C001,
C002 and so on.

Code:
Output:

21. Write a program to create a dataframe named player and store their data in the columns like
team, no.of matches, runs and average. Assign player name as row index and display only those
players details whose score is more than 1000.

Code:

Output:

22. Write a program to represent the data on the ratings of mobile games on bar chart. The sample
data is given as:

Pubg, FreeFire, MineCraft, GTA-V, Call of duty, FIFA 22. The rating for each game is as :
4.5,4.8,4.7,4.6,4.1,4.

Code:
Output:

23. Consider the following data of a clothes store and plot the data on the line chart:

Month Jeans T-Shirts Shirts


March 1500 4400 6500
April 3500 4500 5000
May 6500 5500 5800
June 6700 6000 6300
July 6000 5600 6200
August 6800 6300 4500

Customize the chart as you wish.

Code:
Output:

24. Observe the given data for monthly sales of one of the salesman for 5 months. Plot them on the
line chart.

Month January February March April May


Sales 2500 2100 1700 3500 3000
Apply the following customization to the chart:

• Title – “Sales Stats”


• Use the “Month” label for X-Axis and “Sales” label for Y-axis
• Display legends
• Use dashed lines with the width 5 point
• Use red color for the line
• Use dot marker with blue edge color and black fill color
Code:

Output:

You might also like