Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 28

Practical File

INFORMATICS PRACTICES

Japji Bamra | Class XI Science


Certificate

This is to certify that Ms. Japji Bamra of class XI Science has


successfully completed the IP project on the topic “Python and
MySQL” as prescribed by Mr. Tegbir Bindra during the academic
session 2023-24 as per the guidelines issued by CBSE.

PAGE 1
INDEX
1. Program to print three numbers and find their sum.
2. Program to convert the given value of tonnes into kg and quintals.
3. Program to convert kilometers into miles.
4. Program to find the largest number out of three given numbers.
5. Program to find the sum of three given numbers and the sum of the non-
duplicate numbers out of them.
6. Program to tell whether the given number is odd or even.
7. Program to find the multiples of a number from the given set of numbers.
8. Program to check if first number is divisible by the second number.
9. Program to calculate the sum, difference, product, quotient or remainder of
two given numbers by giving a choice.
10. Program to calculate the area and perimeter of a circle after giving the user
a choice.
11. Program to extract two list slices out of a given list of numbers. Display and
print the sum of elements of first list slice which contains every other
element of the list between indices 5 to 15. Program should also display the
average of elements in the second list slice that contains every fourth
element of the list.
12. Program that displays options for deleting elements in a list with option for:
if element is to be deleted by value or by using its position or a list slice is to
be deleted.
13. Program to find average score of given marks.
14. Program to arrange the given numbers in ascending order
15. Program to find the minimum value in a given list by
also giving its index.
16. Program that finds the roots of a quadratic equation after asking user for
coefficients.
17. Program to find the sum of natural numbers up until the given value.
18. Program that tells the user what the type of the entered character is.
19. Program to find the sum of all the odd numbers from 1-100.
20. Program that prints the following pattern: * ** *** **** *****.
21. Program to find the count of even number multiples
of 6 from 10-100.
22. Program that prints the following pattern: 1 22 333 4444 55555.
23. Program to find sum of even numbers and odd numbers of a given list.
24. Program that prints the following pattern: A AB ABC ABCD ABCDE.

PAGE 2
25. Program to find out whether the entered integer is negative,
positive or zero.
26. Program that finds out the mean of the given list.
27. Program to find a given element in a list.
28. Program to calculate the simple and compound interest of the given values.
29. Program to give the binary and hexadecimal values of a given integer.
30. Program that finds out the gross profit, net profit, gross profit % and the net
profit %.
31. Program to find the total cost of an item including VAT.
32. Program that finds out the cost of a product after applying discount.
33. Program to reverse the given string.
34. Program to reverse a string with word order maintained.
35. Program that finds out the ASCII values of a given string.
36. Program to enter names of employees and their salaries as input and store
them in a dictionary.
37. Program to convert a number entered by the user into its corresponding
number in words. For example, if the input is 876 then the output should be
'Eight Seven Six'.
38. A dictionary D1 has values in the form of lists of numbers. Write a program
to create a new dictionary D2 having same keys as D1 but values as the sum
of the list elements e.g., D1 = {'A' : [1, 2, 3] , 'B' : [4, 5, 6]} then D2 is {'A' :6, 'B'
: 15}.
39. Program to check if a dictionary is contained in another dictionary.
40. All MySQL commands.

PAGE 3
Program to input three numbers and find their sum.

Program to convert the given value of tonnes into kg and


quintals.

Program to convert kilometers into miles.

PAGE 4
Program to find the largest number out of three given
numbers.

Program to find the sum of three given numbers and the sum
of the non-duplicate numbers out of them.

PAGE 5
Program to tell whether the given number is odd or even.

Program to check if first number is divisible by the second


number.

Program to calculate the area and of a circle after giving the


user a choice. Perimeter.

PAGE 6
Program to find the multiples of a number from the given set
of numbers.

PAGE 7
Program to extract two list slices out of a given list of
numbers. Display and print the sum of elements of first list
slice which contains every other element of the list between
indices 5 to 15. Program should also display the average of
elements in the second list slice that contains every fourth
element of the list.

Program to find average score of given marks.

PAGE 8
Program to calculate the sum, difference, product, quotient or
remainder of two given numbers by giving a choice.

Program to find the minimum value in a given list by


also giving it’s index.

PAGE 9
Program that displays options for deleting elements in a list
with option for: if element is to be deleted by value or by
using its position or a list slice is to be deleted.

Program to find the sum of all the odd numbers from 1-100.

PAGE 10
Program to arrange the given numbers in ascending order.

Program to find the sum of natural numbers up until the


given value.

PAGE 11
Program that finds the roots of a quadratic equation after
asking user for coefficients.

Program that tells the user what the type of the entered
character is.

PAGE 12
Program that prints the following pattern:
*
**
***
****
*****

Program that prints the following pattern:


1
22
333
4444
55555

PAGE 13
Program to find the count of even number multiples
of 6 from 10-100.

Program to find sum of even numbers and odd numbers


of a given list.

Program to find out whether the entered integer is negative,


positive or zero.

PAGE 14
Program that prints the following pattern:
A
AB
ABC
ABCD
ABCDE

Program that finds out the mean of the given list.

PAGE 15
Program to find a given element in a list.

Program to calculate the simple and compound interest of the


given values.

PAGE 16
Program to give the binary and hexadecimal values
of a given integer.

Program that finds out the gross profit, net profit, gross profit
% and the net profit %.

PAGE 17
Program to find the total cost of an item including VAT.

Program that finds out the cost of a product after applying


discount.

PAGE 18
Program to reverse the given string.

Program to reverse a string with word order maintained.

PAGE 19
Program to find ‘n’ number of multiples of a given number.

Program that finds out the ASCII values of a given string.

PAGE 20
Program to enter names of employees and their salaries as
input and store them in a dictionary.

Program to convert a number entered by the user into its


corresponding number in words. For example, if the input is
876 then the output should be 'Eight Seven Six'.

PAGE 21
A dictionary D1 has values in the form of lists of numbers.
Write a program to create a new dictionary D2 having same
keys as D1 but values as the sum of the list elements e.g.,
D1 = {'A' : [1, 2, 3] , 'B' : [4, 5, 6]} then D2 is {'A' :6, 'B' : 15}.

Program to check if a dictionary is contained in another


dictionary.

PAGE 22
MySQL commands.
1. CREATE DATABASE
 This query is used to create a database.

2. USE DATABASE
 This query is used to change the database in use.

3. CREATE TABLE
 This query is used to create a table with column names, data types and any other
constraints to be applied.

4. ALTER TABLE
 This query is used to make structural changes in the table like inserting a new
column, changing the data type or size of a column, or to add an integrity
constraint.

5. INSERT INTO
 This query is used to insert data values in the table.

PAGE 23
6. DESC
 This query is used to see the description of the table structure.

7. ORDER BY
 This query is used to sort the results in ascending or descending order. By default
the result is sorted in ascending order.

8. GROUP BY
 This query is used to group the results on the basis of a column.

PAGE 24
9. DROP COLUMN
 This query is used to delete a column from the table.

10. DELETE DATA


 This query is used to delete data rows from the table on the basis of a condition.

11. UPDATE DATA


 This query is used to change the values in the table.

PAGE 25
12. JOIN
 This query is used to combine the results from two tables on the basis of one
common column in both the tables.
 It is of two types – LEFT JOIN and RIGHT JOIN.
 LEFT JOIN: This query is used to extract all the rows from table 1, even if no entry
matches in table 2. Syntax: SELECT * FROM table1, table2 LEFT JOIN table1
WHERE table1.columnname=table2.columnname.
 RIGHT JOIN: This query is used to extract all the rows from table 2, even if no
entry matches in table 1. Syntax: SELECT * FROM table1, table2 RIGHT JOIN table2
WHERE table1.columnname=table2.columnname.

13. DROP TABLE


 This query is used to delete the entire table.

PAGE 26
14. PATTERN MATCH
 This query is used to replace the alphabets in a search query.
a. %: This symbol is used to replace any number of alphabets.
b. _: This This symbol is used to replace only one of alphabet.

15. COMMIT
 This query is used to end the current transaction by saving database changes and
starts a new transaction.

16. ROLLBACK
 This query ends the current transaction by discarding the previous changes.

17. SAVEPOINT
 This query defines a breakpoint for the transaction to allow partial rollbacks.

PAGE 27

You might also like