You are on page 1of 19

PRACTICAL ASSIGNMENT-01

Date: 01/04/2023
Q. Write a program in python with the help of a function number_words.
That takes a 2 digit number and returns the equivalent number.

Code:

Output:
PRACTICAL ASSIGNMENT-02
Date: 04/04/2023
Q. Write a program in python using a function rev_string that takes the
string and returns its reverse.

Code:

Output:
PRACTICAL ASSIGNMENT-03
Date: 11/04/2023
Q. Write a program in python using a function initial_name() which takes
the full name as a parameter and returns the initial name.

Code:

Output:

PRACTICAL ASSIGNMENT-04
Date: 18/04/2023
Q. Write a program in python with or without function to mimic a lucky 7
game. Based on the amount bid, a person would be a winner or a loser.
A lucky 7 winner will get thrice the amount of bid, rest will get double.

Code:

Output:
PRACTICAL ASSIGNMENT-07
Date: 02/05/2023
Q. Write a program in python to input text in a file source.txt and display
it in word wise reverse manner.

Code:

Output:

PRACTICAL ASSIGNMENT-08
Date: 09/05/2023
Q. Write a function that takes a file ‘original.txt’ as parameter and returns
another file ‘sorted.txt’ if ‘original.txt’ contains names: ravi, akshat,
ZUBIN, shyam, inder the ‘sorted.txt’ must contains ZUBIN, akshat, inder,
ravi, shyam

Code:
Output:

Output:

PRACTICAL ASSIGNMENT-09
Date: 09/05/2023
Q. Write a function that takes a file ‘first.txt’ and returns a file ‘second.txt’

Code:

Output:

PRACTICAL ASSIGNMENT-10
Date: 18/07/2023
Q. Create a database with your name. Inside database create a table
product.write the commands for following:

1. Display entire data

2. Display product name only for category soap.

3. Display all the products with prices more than 500.

4. Display all the products having exactly 6 characters.


5.Display entire data sorted on names.
PRACTICAL ASSIGNMENT-11
Date: 21/07/2023
Q.in the table of assignment 10 do following:

1. Add an new column quantity.

2. Find the total value of the table product.

3. Find the average quantity.

4. Find the category wise values of each category.

5. Find the minimum and maximum quantity of product.


PRACTICAL ASSIGNMENT-12
Date: 25/07/2023
Q. Create a table address and perform the the given tasks(without join)
1. Display the complete data from both the tables.

2. Display name, salary, and city for residents of mumbai

3. Display all the columns from both the tables(without repeating empno)

4. Display city and sum of salary of all employees city wise

PRACTICAL ASSIGNMENT-13
Date: 25/07/2023
Q. Create a table address and perform the the given tasks(with join)
1. Display the complete data from both the tables.

2. Display name, salary, and city for residents of mumbai

3. Display all the columns from both the tables(without repeating empno)

4. Display city and sum of salary of all employees city wise

PRACTICAL ASSIGNMENT-14
Date: 02/08/2023
Q1. Create a table product (pid, name, price).
2. Alter its creation, set pid as primary key.

3. Remove pid as primary key.

4. Create a table stock with column details item int primary key, pname
varchar(10) not null, part_no int unique, category varchar(10) default.

PRACTICAL ASSIGNMENT-15
Date: 02/08/2023
Q1. Create table bank with columns ac_no, cust_name, balance
2. Enter data:

3. Create table transaction with columns trans_no, amount, mode, ac_no

PRACTICAL ASSIGNMENT-16
Date: 08/08/2023
Q1. create a table student with columns roll_no, name, dob, doa and
display all values.

2. Display roll number, name of students who were admitted in the


month of june.

3. Display name and their corresponding day of week for those before
the year of birth 2006.

4.Display name and month name for both dob and doa.
5. Display day of week for dob in 3 letter form.

PRACTICAL ASSIGNMENT-17
Date: 11/08/2023
Q1. Create a table new_harsh with columns sid, sport, nop and display
them

2. Create a connection between python and my SQL

3. Show the data of players whose sport is football

You might also like