0% found this document useful (0 votes)
178 views30 pages

Practical File

The document summarizes 14 practical assignments completed as part of a Computer Science course. The practicals cover topics like printing the absolute difference between numbers, traversing and printing string elements, finding the largest number in a list, removing duplicates from a list, sorting lists using bubble sort and insertion sort, using a dictionary to input names and contacts, constructing a die rolling function, exploring variable scope, reading data from and writing to files, implementing stacks and queues using lists, checking for palindromes using stacks, performing set operations, and connecting to a MySQL database to create tables and perform CRUD operations.

Uploaded by

Parth Dabas
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
0% found this document useful (0 votes)
178 views30 pages

Practical File

The document summarizes 14 practical assignments completed as part of a Computer Science course. The practicals cover topics like printing the absolute difference between numbers, traversing and printing string elements, finding the largest number in a list, removing duplicates from a list, sorting lists using bubble sort and insertion sort, using a dictionary to input names and contacts, constructing a die rolling function, exploring variable scope, reading data from and writing to files, implementing stacks and queues using lists, checking for palindromes using stacks, performing set operations, and connecting to a MySQL database to create tables and perform CRUD operations.

Uploaded by

Parth Dabas
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/ 30

By - Parth Dabas

Practical File XII


Vishwa International
Computer Science Academy

PRACTICAL #01

AIM: To print the absolute difference between 2 numbers

OUTPUT:

2
PRACTICAL #02

AIM: To traverse through a a given string and print it’s elements

OUTPUT: OUTPUT:

3
PRACTICAL #03

AIM: To construct a function to get largest number from a list

OUTPUT:

4
PRACTICAL #04

AIM: To construct a function to remove duplicates from a list

OUTPUT:

5
PRACTICAL #05

AIM: To construct a bubble sort function and use it to sort a list

OUTPUT:

6
PRACTICAL #06

AIM: To construct an Insertion sort function and use it to sort a list

OUTPUT:

7
PRACTICAL #07
AIM: To use a user build dictionary to input names and contacts and output only selective ones

OUTPUT:

8
PRACTICAL #08

AIM: To construct a die rolling function

OUTPUT:

9
PRACTICAL #09 PRACTICAL #10
AIM: To output a Fibonacci series using different methods

OUTPUT:

10
PRACTICAL #11
AIM: To explore the scope of variables

OUTPUT:

11
PRACTICAL #12
AIM: To read data from a file and find it’s size

OUTPUT:

12
PRACTICAL #13
AIM: To read specific columns from a file and print the contents of the file

OUTPUT:

13
PRACTICAL #14
AIM: To create CSV
files using different
methods

14
OUTPUT PRACTICAL #14

15
PRACTICAL #14
AIM: To obtain data number divisible by 2 and 4 using data file

OUTPUT:

16

PRACTICAL #15
AIM: To construct and use a reader function and writer function

OUTPUT:

17

PRACTICAL #16
AIM: To implement stack using list in Python OUTPUT :

18
PRACTICAL #17
AIM: To generate values from 1 to 10 and then remove all the odd numbers from the list

OUTPUT:

19
PRACTICAL #18
AIM: To check whether a string is a palindrome or not using stack.

OUTPUT:

20
PRACTICAL #19
AIM: To generate a set of prime numbers and another set of odd numbers and display
the result of union, intersection, difference and symmetric difference operations

OUTPUT:

21
SQL
Question#1

22
Answers#1

23
24
25
Question#2

Answers#2

26
27
INTEGRATED PYTHON AND SQL
AIM:
To write a MySQL connectivity program in Python to
◦ Create a database school
◦ Create a table students with the specifications – ROLLNO
integer, STNAME character(10) in MySQL and perform the
following operations:
▪ Insert two records in it
▪ Display the contents of the table

28

Code [1]:

29
OUTPUT:

30

You might also like