Professional Documents
Culture Documents
PRACTICAL LIST
PRACTICAL - 1
1. Find the largest number from 3 numbers and print on the screen.
2. Take 3 variables and assign random numbers and display it. (using random package)
3. Take 3 variables and assign int and float values to it. Display 1st variable int value, 2nd
variable float value and 3rd variable complex value. (X = 20.5, Y = 20+5j, Z = 20)
4. Find mistake/s in program:
print(2my-first_name)
last-name=float(my-first_name)
Print(last-name)
PRACTICAL - 2
age = 36
1. Print value of a.
2. Print first character.
3. Print 2nd to 5th character.
4. Remove extra space at last.
5. Find length of a string.
6. Convert all letters into lower case.
7. Convert all letters into upper case.
8. Using age and txt, display “My name is John, and I am 36 years old.”
9. Use following methods for your knowledge:
endswith() Returns true if the string ends with the specified value
find() Searches the string for a specified value and returns the position of
where it was found
index() Searches the string for a specified value and returns the position of
where it was found
islower() Returns True if all characters in the string are lower case
isupper() Returns True if all characters in the string are upper case
join() Joins the elements of an iterable to the end of the string
rfind() Searches the string for a specified value and returns the last
position of where it was found
rindex() Searches the string for a specified value and returns the last
position of where it was found
rpartition() Returns a tuple where the string is parted into three parts
rsplit() Splits the string at the specified separator, and returns a list
split() Splits the string at the specified separator, and returns a list
swapcase() Swaps cases, lower case becomes upper case and vice versa
zfill() Fills the string with a specified number of 0 values at the beginning
PRACTICAL - 3
my_List = [3, 8, 1, 6, 0, 8, 4]
my_Tuple = (3, 8, 1, 6, 0, 8, 4)
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
PRACTICAL - 4
1. Create a text(.txt) file which stores student‟s enrollment no. and name in a table
structure. Read the data from a text file and perform the random sampling on the data.
2. Create a CSV file which stores Student‟s Enrollment No, Name, Semester, Department,
Email, Mobile, Age (File should contain at least 30 records). Read the data from a file
using pandas library and print it.
3. Load image from file into memory using Scikit-image library. Print shape and size of the
image. Resize the image as per your requirement. Plot both the images using matplotlib
library.
PRACTICAL - 5
1. Create a Dataframe object using a list and dictionary which stores student data of your
class. Show how to access specific rows and columns from it.
2. Create an XML file which stores student‟s data. Parse data from a file and create a
dataframe object of it. Find duplicate values in a dataframe and remove all duplicate
values.
3. Create a Dataframe object of car data which includes columns like car model, brand,
color, manufacturing year, transmission type, car type(Sedan,Hatchback,SUV,Mini
SUV,Convertible). Create a categorical variable for car type which includes categories
(Sedan,Hatchback,SUV). Find the records in the data frame which are not in the range
of defined categories.
4. Using datetime module, print current date in „Mon, 31 August 2020‟ format. Add 5 hour
and 30 min in current date time and print new datetime. Count your exact age using
birthdate and current datetime.
5. Show how an Imputer module can be useful to deal with missing values.
PRACTICAL - 6
1. Draw a PIE chart which displays the number of laptops from different companies used
by the students in your class. Use appropriate colors and labels. Use following data:
20 15 7 5 10
PRACTICAL - 7
Package: Sklearn.feature_extraction
import sys
OR
a. Mean
b. Median
c. Variance
d. Range
e. Quartile
f. Skewness
g. Kurtosis