Questions Practical File
Questions Practical File
Name:
Class and Section:
1|Page
INDEX:
2|Page
1. Write python code to create the following series ‘Result’ using list and using dictionary.
Raj 99
Ajay 50
Vijay 75
Gourav 85
Tina 55
Amay 35
Aakash 40
3|Page
3. Create the following dataframe using list:
Rno Name Marks
A 10 Raj 50
B 20 Ajay 60
C 30 Minu 80
D 40 Raj 35
E 50 Aakash 90
Now display records of students who have got marks more than 70.
4. Write a python code to create a dataframe with appropriate headings from the list given below
:
[10, 'Raj’, 70], [20, 'Ajay', 69], [30, 'Vijay', 75], ['40', 'Tina', 99]
4|Page
Write python code to arrange this dataframe in ascending order of names. The changes should
be saved in the original dataframe.
Indore 10
Bhopal 50
Indore 5
Mumbai 60
Bhopal 90
Mumbai 75
Now as we can see there are negative values in Points column. The program should replace all
the negative values with 0. The resulting output should be:
5|Page
9. Write a program that creates a dataframe that looks like following:
Now print only the records of students who have got marks more than or equal to 70 but less
than 95.
Write python code for removing the records of students of Arts stream.
6|Page
12. Write program to create and display the following dataframe (df) and to perform the below
given operations.
Write python code to add three new columns – ‘Total’, ‘Percent’ and ‘Grade’. These columns
should contain following data:
- The Percent column should store the percentage based on total marks obtained.(Total
marks out of 200)
- The Grade column should store Grades as ‘A’ or ‘B’ as per following conditions:
If percentage is > 70 then ‘A’ Grade otherwise ‘B’ Grade
7|Page
15. Create a dataframe ‘result’ given as:
Rno Names Marks
0 10 Raj 50
1 20 Ajay 60
2 30 Vijay 85
3 40 Gourav 80
4 50 Tina 90
8|Page
17. Create a dataframe containing all records of the table. The dataframe may look like
following:
Now create a bar chart showing the performance of each student. Take names on x axis and
Marks on Y axis. Also use proper headings for chart and axis. The output should look like
following:
9|Page
18. Consider the data given below:
App Name App Price in Rs Total Downloads (In thousands)
Angry Birds 100 197
Teen Titans 50 210
PUBG Mobile 200 414
Marvel Comics 150 196
Fun Run 25 272
WhatsApp 10 668
Temple Run 170 420
Google Duo 70 110
Using the above data, plot a bar chart that plots multiple bars for both App price and Total
downloads.
Score = [8, 10, 15, 25, 28, 35, 47, 49, 50, 63, 67, 53, 57, 58, 69, 85, 83, 75, 95, 97, 87, 93, 98, 100]
10 | P a g e
Also modify x axis values so that it shows difference of 10 between two bins.
20. The names of students and marks obtained in two semesters are given as:
Using this data, write python code to draw a chart which looks like following:
11 | P a g e
21. Consider the following table PREPAID. Write SQL Commands for (a) to (j)
22. Write SQL Commands for (a) to (j) based on the table CLUB.
12 | P a g e
a. To show all information about the SWIMMING coaches in the club.
b. To list names of all coaches with their date of appointment in descending order.
c. To display coach name, pay, age and bonus (as 15% of pay) for all coaches.
d. To select the minimum age of female coaches.
e. To count how many employees working in each age group.
f. To display sports wise total pay only for those records where there are more than one
coaches.
g. Display records of coaches who have joined in the month of march.
h. Display coach name and date of appointment for the coaches who have joined after
the year 1996.
i. Display minimum and maximum pay for male and female coaches (use one select
statement).
j. Increase the pay of all female coaches by 5%.
13 | P a g e