0% found this document useful (0 votes)
5 views40 pages

Python and SQL Programming Tasks

The document outlines a series of programming tasks, including reading text files, counting characters, generating random numbers, and manipulating data in a MySQL database. Each program is described with its intended input and output. Additionally, it includes SQL commands for data manipulation and Python-MYSQL interface programs.

Uploaded by

raja786vaibhavi
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)
5 views40 pages

Python and SQL Programming Tasks

The document outlines a series of programming tasks, including reading text files, counting characters, generating random numbers, and manipulating data in a MySQL database. Each program is described with its intended input and output. Additionally, it includes SQL commands for data manipulation and Python-MYSQL interface programs.

Uploaded by

raja786vaibhavi
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

: :

:
PROGRAM 1
Read the text line by line and display
Each word separated by #

Input:

Output:
PROGRAM 2
Read a text file and display the number
of vowels/consonants character in the file

Input:

Output:
PROGRAM 3
Read a text file and display the number of
uppercase/
lowercase character in the file

Input:

Output:
PROGRAM 4
Remove all the lines that contain the character
in a file and write it to another file

Input:

Output:
PROGRAM 5
Create a binary file with name and roll number .
Search for a given roll number and display the name ,
if fnot found display with appropriate message

Input:
Output:
PROGRAM 6
Create a binary file with roll number ,
namr and [Link] a roll number and update the marks

Input:
Output:
PROGRAM 7
Write a random number generator that generates
random numbers between 1 and 6(simulates a dice).

Input:

Output:
PROGRAM 8
Write a python program to implement
a stack using list.
Input:
Output:
PROGRAM 9
Create a CSV file by entering user-id
and password ,read and search the password
For given user id .

Input:
Output:
PROGRAM 10
Write a python program to find out sum
of Two number using function.

Input:

Output:
PROGRAM 11
Write a program to print cubes of numbers
in the range of 15 to 20

Input:

Output:
PROGRAM 12
write a program to print square of every alternate number
in the range of 1 to 10

Input:

Output:
PROGRAM 13
Write a program to print a Multiplication table

Input:

Output:
PROGRAM 14
Program that reads a line and print
its number of uppercase/lowercase/alphabets/digits

Input:

Output:
PROGRAM 15
Write a program to create a dictionary containing
Names of competition winner studenta as keys
And number of their wins as values.

Input:

Output:
SQL COMMANDS
Create a student table and insert
data.
Implement the following SQL
commands on the student
table:

1. UPDATE table to modify data:


[Link](Row delete):

3. Insert into command:


[Link] by to display data in ascending/descending order.

Descending:

Ascending:
[Link] by and find the min,max,sum
,count and average

Min():

Max():

Sum():
AVG():

Count():
PYTHON -MYSQL
INTERFACE
PROGRAM
PROGRAM 1
Write a python program that displays
first three rows fetched form student
table of MYSQL database "test"

Input:
Output :
PROGRAM 2
Update table data in MYSQL through python.

Input:

Output:
PROGRAM 3
Programme to check python and MYSQL connection.

Input:

Output:
PROGRAM 4
Insert some data in the table.

Input:
Output:

You might also like