0% found this document useful (0 votes)
3 views

Computer Science Practical File

This document is a practical file for Computer Science submitted by Nayana Santhosh, containing a list of programming tasks and queries related to various concepts in Python and MySQL. The tasks include calculations, data manipulation, file handling, and database operations. It serves as a comprehensive guide for practical exercises in the subject, showcasing the application of programming skills.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Computer Science Practical File

This document is a practical file for Computer Science submitted by Nayana Santhosh, containing a list of programming tasks and queries related to various concepts in Python and MySQL. The tasks include calculations, data manipulation, file handling, and database operations. It serves as a comprehensive guide for practical exercises in the subject, showcasing the application of programming skills.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 43

COMPUTER

SCIENCE
PRACTICAL FILE

CBSE ROLL NO:


NAME: NAYANA SANTHOSH
CLASS: XII A
SUBJECT: COMPUTER SCIENCE
SUBJECT CODE: 083
SUBMITTED TO: MS. RISHU KAUL (PGT CS)

S.NO PROGRAM
.
1. Calculate area of triangle.
2. Take entries into a dictionary.
3. Count vowels in a string.
4. Remove odd numbers from list.
5. Remove elements that end with 3.
6. Check if string is palindrome.
7. Produce a Fibonacci range.
8. Calculate factorial.
9. Check if number is Armstrong.
10. Create a basic calculator.
11. Print a pattern of any symbol.
12. Calculate percentage of marks.
13. Check whether number is odd or
even.
14. Calculate simple interest.
15. Calculate x^n of given numbers.
16. Calculate sum of all elements in list.
17. Check if input number is prime.
18. Program of global and local variables.

S.NO PROGRAM
.

19. Generate a random no of dice.


20. To ensure input value is integer.
21. To read a file line by line and print it.
22. To remove all the lines having ‘a’.
23. Read a text file and display uppercase,
lowercase
Vowels and consonants in a file.
24. Read a file and separate words by #
25. Create a binary file with name and roll no
26. Create a csv file with user Id and password
27. To implement a stack
28. Random number generator for a dice
29. To implement a stack for employee details
30. A function to input into a stack and pop out
information.
31. To show MySQL connectivity in Python.
32. To retrieve data from a table Emp in MySQL.
33. To add records into a database in MySQL.
34. To update records into a database in MySQL.
35. To delete records into a database in MySQL.
36.
Q1. Program to calculate the area of any triangle:

Output:
Q2. Program to take entries into a dictionary of
countries and capitals and search:
Output:

Q3. Program to count vowels in any string:


Output:

Q4. Program to remove odd numbers from any list:


Output:

Q5. Program to remove elements from a list that


end with 3:
Output:

Q6. Program to check whether a given string is a


palindrome:
Output:

Q7. Program to produce a Fibonacci range of


numbers from any given number:
Output:
Q8. Program to calculate the factorial of any
number:

Output:
Q9. Program to check whether a given number is
an armstrong number:

Output:
Q10. Program to create a calculator:

Output:
Q11. Program to print a pattern of any symbol:

Output:
Q12. Program to calculate the percentage of
marks:

Output:
Q13. Program to check whether a number is odd
or even:

Output:
Q14. Program to calculate the simple interest:

Output:
Q15. Program to calculate the x^n of any two
given numbers:

Output:
Q16. Program to calculate the sum of all elements
in a list:

Output:
Q17. Program to find out whether a number is
prime or not:

Output:
Q18. Program of global and local variables:

Q19. Program of generating a random no of a


dice:
Q20. Program to check if the input is an integer:

Output:

Q21. Program to read a file line by line:

Output:
Q22. Program to remove lines containing a and
write into a new file:

Output:
Q23. Program to count vowels, consonants,
uppercase and lowercase characters:

Output:
Q24. Program to separate words by # in a text
file:

Output:

Q25. Program of generating a random no of a


dice:
Q26. Program to write roll no and name into a
binary file and retrieve name by roll no:

Output:
Q27. Program to make a csv file with username
and password and retrieve data by username:

Output:
Q28. Program to implement a stack:

Output:
Q29. Program to implement a stack for employee
details:

Output:
Q30. Program to implement mysql connectivity in
python:

Output:

Q31. To retrieve data from a table Emp in


MySQL.
QUERIES SET 1

1.

2.
3.

4.

5.
6.

QUERIES SET 2
1.

2.
3.

4.

5.

6.
7.

8.

9.

10.
QUERIES SET 3

a) Create a database ‘Sports’.

b) Create a table ‘team’ with following considerations:


 It should have a column TeamID for storing an integer value
from 1 to 9, which refers to unique identification of a team.
 Each team should have its associated name (TeamName),
which should be a string of length not less than 10
characters.
 Using table level constraint, make the TeamId a primary key.

c) Show the structure of the table.

d) As per the preferences, add the following information into the


table:
 Row 1: (1, Tehlka)
 Row 2: (2, Toofan)
 Row3: (3, Aandhi)
 Row4: (4, Shailab)
e) Now create table Match_Details.
QUERIES SET 4

a)Display Match Id, Team ID, Team score who scored more than
70 in first inning, along with the team name.

b) Display match ID, Team Name and second Team Score


between 100 to 160.

c) Display Match ID, Team Names along with Match dates


d) Display unique team names

e) Display match Id and Match dates played by Aandhi and


Shailab
QUERIES SET 5

a)Display all items in the ascending order of stock dates.

b) Display maximum price of items for each dealer individually as


per dcode from stock
c) Display all items in descending order by team names.

d) Display average price of items for each dealer individually as


per dcode from stock which average price is more than five.

e) Display the sum of quantity for each dcode.

You might also like