0% found this document useful (0 votes)
3 views23 pages

SQL and Python Integration Programs

The document contains a series of programming tasks that involve integrating SQL with Python using the MySQL module for various operations such as creating, searching, deleting, and updating employee and student records. Additionally, it includes tasks for file manipulation, such as reading text files, counting character types, and removing specific lines, as well as implementing data structures like stacks. Each task is accompanied by a placeholder for source code and expected output.
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)
3 views23 pages

SQL and Python Integration Programs

The document contains a series of programming tasks that involve integrating SQL with Python using the MySQL module for various operations such as creating, searching, deleting, and updating employee and student records. Additionally, it includes tasks for file manipulation, such as reading text files, counting character types, and removing specific lines, as well as implementing data structures like stacks. Each task is accompanied by a placeholder for source code and expected output.
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

17) Write a Program to integrate SQL with Python by importing the MySQL module and create a

record of employee and display the record.

SOURCE CODE:

OUTPUT:
18) Write a Program to integrate SQL with Python by importing the MYSQL module to search an employee
number in table employee and display record, if employee not found display appropriate message.

REFERENCE TABLE:

SOURCE CODE:

OUTPUT:
19) Write a Program to integrate SQL with Python by importing the MYSQL module to delete the record of
entered Student rollno

REFERENCE TABLE:

SOURCE CODE:

OUTPUT:
20) Write a Program to integrate SQL with Python by importing the MYSQL module to update the employee
record of entered eno.
REFERENCE TABLE:

SOURCE CODE:

OUTPUT:
6) Write a Python program to read a text file line by line and display each word separated by a ‘#’

TEXT FILE: ([Link])

SOURCE CODE:

OUTPUT:
7) Write a python program to read a text file and display the number of
vowels/consonants/uppercase/lowercase characters in the file

TEXT FILE: ([Link])

SOURCE CODE:

OUTPUT:
11) Write a python program to create a binary file with name and roll number and perform search based
on roll number. If not found, display an appropriate message.

SOURCE CODE:

OUTPUT:
12) Write a python program to create a binary file with roll number, name and marks and update the marks
using their roll numbers

SOURCE CODE:

OUTPUT:
9) Write a Python program to remove all the lines that contain the character ‘a’ in a file and write it to another
file.

TEXT FILE: ([Link])

Source code:

Output:
14) Write a Python program to implement a stack using a list data-structure.
SOURCE CODE:

OUTPUT:
10) Write a Python program to create a CSV file with name and roll number and perform search for a
given roll number and display the name. If not found, display an appropriate message.
OUTPUT:
2) Write a Program to find the sum of elements of list recursively.

SOURCE CODE:

OUTPUT:
1) Write a program using function to compute the nth Fibonacci number.

SOURCE CODE:

OUTPUT:
8) Write a Program to search any word in given string/sentence

SOURCE CODE:

OUTPUT:
13) Write a program to take 10 sample phishing email, and find the most common word occurring

SOURCE CODE:

OUTPUT:
5) Write a program to find the factorial of a given number:
Source Code:

Output:
3) Write a python program to generate a random number between 1 and 6 (simulates a dice) Source

Code:

Output:
4) Write a python program to find whether the given number is prime or not.
Source Code:

Output:
16) Write a python program to implement stack using a list data-structure to perform the following operations:
i) To Push an object containing Doc-ID and Doc_name of doctors who are specialized
as “ENT” to the stack.
ii) To Pop the objects from the stack and display them.
iii) To display the elements of the stack (after performing Push and Pop)
Source Code:

Output:
15) Write a program, with separate user-defined functions to perform the following operations:
(i) To Create a function Push(Stk,D) Where Stack is an empty list and D is Dictionary of Items.
from this Dictionary Push the keys (name of the student) into a stack, where the
corresponding value (marks) is greater than 70.
(ii) To Create a Function Pop(Stk) , where Stk is a Stack implemented by a list of student names.
The function returns the items deleted from the stack.
(iii) To display the elements of the stack (after performing PUSH or POP).

Source Code:
Output:

You might also like