Lab Questions
Programming In Python (UKLC2DSCDAT104)
Python Programming (+Lab) (UKLC2DSCML103)
Dr. Sudha S K
Department of Computer Science
Course Objectives
By the end of this course, students will be able to:
Course Description CL
Outcome
CO1 Understand the fundamentals of problem solving U
and programming
CO2 Understand basic concepts of Python U
programming
CO3 Familiarization in data types and functions U, Ap
CO4 Apply Python programming language and An, Ap
relevant libraries for data manipulation
CO5 Analyze data processing and file handling in An, Ap
Python
Experiment #7: Demonstration of if-elif Statement
Aim: Write a program to find the largest number among the three input
numbers.
Program:
Output:
Result: The if–elif statement in Python is successfully demonstrated
by finding the largest number among three inputs.
Experiment #8: Password Validation Using Regular Expressions
Aim: To write a Python script to check whether a given password is valid or not based on
the following conditions:
• The password should contain at least one numeric digit.
• The password should contain at least one uppercase letter and one lowercase letter.
• The password should contain at least one special character.
• The password length should be between 6 and 15 characters.
Output:
Result: The Python program using regular expressions was successfully
executed and validated the password based on the given conditions.
Experiment #9: Bank Account Using Class and Methods
Aim:
To implement a simple bank account using a class.
Program:
Output:
Result: The banking program using class and methods are
successfully executed.
Experiment #10: File Operations in Python
Aim:
To write a Python program to demonstrate basic file operations such as creating a file,
writing data, reading data, and appending data.
Program:
Output:
Result:
The Python program to demonstrate file operations (write, read, and
append) was executed successfully.
Experiment #11: Data Visualization using Matplotlib
Aim:
To write a Python program to demonstrate data visualization using the Matplotlib library.
Program:
Output:
Result:
Result:
The Python program to create a bar chart using Matplotlib was executed successfully.
Experiment #12: Data Analysis using Pandas
Aim:
To write a Python program to perform basic data analysis operations using the Pandas
library.
Program:
Output:
Result:
Result:
The Python program to perform basic data analysis using the Pandas library was executed
successfully.
Experiment #13: Turtle Graphics Using Python
Aim
To use the Turtle graphics module in Python to draw basic geometric shapes and patterns.
Program:
Output:
Result: The program successfully demonstrated the use of Turtle graphics to
create a simple pattern.
Experiment #14: Merging, Joining and Concatenating
DataFrames
Aim
To perform merging, joining, and concatenation operations on DataFrames
using the Pandas library in Python.
Program:
Output:
Result: The program successfully demonstrated merging, joining, and
concatenating DataFrames using the Pandas library in Python.
Experiment #15: Demonstration of Inheritance
Aim: To demonstrate inheritance in Python.
Program:
Output:
Result: The program demonstrated inheritance by deriving a child class from a
parent class.