Professional Documents
Culture Documents
Assignment 22778 19835 612cbc1d69fbb
Assignment 22778 19835 612cbc1d69fbb
Sr.
Name Of Program
No.
Threading and Multithreading :
1. Write A program to demonstrate:
A. Creating a Thread without using any class
B. Creating a Thread by extending Thread class
C. Creating a Thread without extending Thread class
D. Use of getname(), setname(),isalive(), Join(),enumerate() etc.
E. Deamon Thread.
3. Write a demo Program for synchronization using RLock. Accept the two numbers from
user and calculate factorial of both the numbers.
( Hint : use Rlock(), aquire(), release() methods)
4. Write a program to demonstrate the use of semaphore(n) method with python Multithreading
concept. Accept ‘n’ from user.
( Hint: use Five threads and n is two )
Note : Semaphore can be used to limit the access to the shared resources with limited capacity.
1
File Operation:
1. Write a Python Program to Read the Contents of a text File and display the following information.
a. Total number of characters, digits, special symbols, words, spaces and lines.
b. Path of the current file.
2. Write a program to read the first and last ‘n’ lines of a file. Prompt the user to enter the value for n.
3. Write a program that reads the contents of the file and counts the occurrences of each letter. Prompt
the user to enter the filename.
4. Write Python Program to Read and Print Each Line in "India. txt" file. (use with statement).
5. Write Python program to remove the comment character from all the lines in a given Python source
file.
6. Write Python Program to Reverse Each Word in "data.txt" file.
7. Write Python Program to Find the Longest Word in a File. Get the File Name from User.
8. Write Python Program to Create a New Image from an Existing Image.
9. Write Python Program to Save Dictionary in Python Pickle.
10. Write a Menu driven Python program to write, read and display each row in "marks.csv" CSV file.
2
Sample :
11. Write Python program to write the data given below to a CSV file. Category, Winner, Film,
Year
12. Write a menu driven Python program to Describe the methods available in the os module.
Database Interaction:
Perform the following operations using MongoDB Atlas/Compas/shell
1. Create collection ‘emp’ and insert five documents.
2. Program for performing CRUD (Create , Read, Update, Delete ) operation. Use various methods
3 used for CRUD.
Hint :
1. Insert – insert(), insertOne(), insertMany()
2. Update - update(), updateOne(), updatemany()
3. Read - find()
4. Delete – deleteOne(), deleteMany()
2
Data Analysis:
Numpy:
1. Write a Program to illustrate following numpy array attributes.
ndarray.ndim
ndarray.shape
ndarray.size
ndarray.dtype
ndarray.itemsize
ndarray.data
2. Write a Program to Basic Arithmetic Operations on NumPy Arrays.
3. Write a Program to demonstrative NumPy Arrays Creation Functions: -
np.zeros() Creates an array of zeros
np.ones() Creates an array of ones
np.empty() Creates an empty array
np.full() Creates a full array
np.eye() Creates an identity matrix
np.random. random() Creates an array with random values
4
4. Create two 2-d Numpy Arrays (Matrix A, Matrix B) and perform the following operation on
matrix
a. Addition ( A+B)
b. Multiplication ( AxB)
c. Scalar Multiplication (A x integer or integer x A)
d. Transpose of Matrix
3
Data Analysis:
(Note: Visit shared folder to download supporting ‘csv’ files.)
Pandas:
Use Automobile Dataset (Automobile_data.csv) and perform following operations for data analysis.
This Dataset has different characteristics of an auto such as body-style, wheel-base, engine-type, price,
mileage, horsepower, etc.
1. From the given dataset print the first and last five rows
2. Find the most expensive car company name
3. Print All Toyota Cars details
4. Count total cars per company
5. Find each company’s Highest price car
5 6. Find the average mileage of each car making company
7. Sort all cars by Price column
8. Apply the rank to the cars average-mileage. ( highest average-mileage – rank 1, so on)
10. Create two data frames using the following two Dicts, Merge two data frames, and append the
second data frame as a new column to the first data frame.
a. Car_Price = {'Company': ['Toyota', 'Honda', 'BMV', 'Audi'], 'Price': [23845, 17995, 135925 , 71400]}
b. Car_Horsepower = {'Company': ['Toyota', 'Honda', 'BMV', 'Audi'], 'horsepower': [141, 80, 182 , 160]}
4
A. Read Total profit of all months and show it
using a line plot
B. Total profit data provided for each month.
Generated line plot must include the following
2. properties: –
I. X label name = Month Number
II. Y label name = Total profit
III. The line plot graph should look like
this.
5
Read the total profit of each month and show it
7. using the histogram to see the most common profit
ranges
The histogram should look like this.
6
MICRO- PROJECTS ON (Develop min. Two projects )