0% found this document useful (0 votes)
14 views

Course File Python

Uploaded by

Payal Govindani
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Course File Python

Uploaded by

Payal Govindani
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE,

BHOPAL

COURSE-FILE
Python CSE AL-306

Year / Semester : II/III sem


:Artificial Intelligence and Machine
Department
learning
Academic Year : 2024-2025
Program : B.Tech

Lakshmi Narain College of Technology Excellence Bhopal

NAME OF FACULTY: PAYAL GOVINDANI


COURSE FILE (LAB)
CONTENTS

DEPARTMENT OF CSE AIML


Page 1
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE,
BHOPAL

Sr. No. Description Page


No.

Time Table (Pasted on the Back side of the File Cover)


1 Attendance Sheet
2 Vision and Mission of the Institute
3 Vision and Mission of the Department
4 Academic Calendar
5 Internal Marks Policy
6 University Scheme of Examination
7 Course Rational & Curriculum
8 Blooms Taxonomy
9 Course Outcomes (COs) & Program Outcomes (POs), Program
Specific Outcomes (PSOs) and Program Educational Objectives
(PEOs)
10 CO-PO & CO-PSO Mapping
11 Course Planning and Coverage (CPC)
12 List of Experiments
13 Details of Experiments Conducted
14 Assessment Rubrics
15 Assessment Sheet (Lab Work & Sessional)
16 Record of Marks: End Sem University Examination (Practical)

DEPARTMENT OF CSE AIML


Page 2
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Individual Time Table

Lakshmi Narain College of Technology Excellence, Bhopal


Time -Table (B.Tech. III Sem) Session: July-Dec 2024

Section: Room No./Building: LNCTE


Branch: AI/ML Classes w.e.f.: 2/09/24
Day/(Period I II III IV V VI VII VIII
&Time) 10:00-11:20 11:20-12:10 12:10- 01:00 01:00-01:50 01:50-02:40 02:40-03:30 03:30-04:15 04:15-5:00
MON
TUE
WED
LUNCH
THU
FRI
SAT

Lab Batch I: From Mentor/Library


Lab Batch II: From

Issued by:
Prepared by: Approved By:

DEPARTMENT OF CSE AIML


Page 3
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE,
BHOPAL

Vision and Mission of the Institute

VISION OF THE INSTITUTE


To become a pioneer institute in technical education and innovations to build competent
technocrats and leaders for the nation.

MISSION OF THE INSTITUTE


M1. To enhance the academic environment with innovative teaching learning processes and
modern tools.

M2. To Practice and nurture high standards of human values, transparency and accountability.

M3. To collaborate with other academic and research institutes as well as industries in order to
strengthen education and research.

M4. To uphold skill development for employability and entrepreneurship for interdisciplinary
research and innovations.

DEPARTMENT OF CSE AIML


Page 4
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE,
BHOPAL

Vision and Mission of the Department

VISION OF THE DEPARTMENT

To be a centre of excellence for providing quality technical education to develop future leaders
with the aspects of research &computing, Software product development and entrepreneurship.

MISSION OF THE DEPARTMENT


M1: To offer academic programme with state of art curriculum having flexibility for
accommodating the latest developments in the areas of Computer science engineering

M2: To conduct research and development activities in contemporary and emerging areas of
computer science & engineering.

M3: To inculcate moral values & entrepreneurial skills to produce professionals capable of
providing socially relevant and sustainable solutions.

DEPARTMENT OF CSE AIML


Page 5
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE,
BHOPAL

Academic Calendar

DEPARTMENT OF CSE AIML


Page 6
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE,
BHOPAL

Marks Policy

B.Tech. I - IV YEAR (Common to all Disciplines)


Grading System w.e.f. Session: July- Dec 2024
Theory Slot (20 Marks)

MST MARKS (Best of two) [OUT OF 20] Total


MIDSEM Marks (MST) 20 20

Theory Slot (10 Marks)

Attendance
Teacher Marks Total
Marks
Quiz Assignment Marks 5 5 10

Practical Slot (20 Marks)

Teacher Assessment
Attendance Marks Total
Marks
Lab Work/sessional Marks 15 5 20
Lab Work/sessional Marks (Language
10 10 20
Lab)

Practical Slot (10 + 10 Marks) for Workshop Practices/ Swachh Bharat Summer Internship Unnat Bharat
Abhiyan / Rural Outreach /Internship-I/II/III
Lab Work ( As-
Teacher Assess-
Attendance Marks signment /Quiz Total
ment Marks
etc.)
Lab Work Marks 5 NIL 5 10
Assignment Quiz /Term work Marks 5 5 NIL 10
Swachh Bharat Summer Internship Unnat 5
5 NIL 10
Bharat Abhiyan / Rural Outreach (MATHEMATICS)
Internship-I/BT107 40 MINIMUM
(as per I year internship 10 RANGE (30 TO 50
training) 50 )
Attendance Mark Distribution
(For MIDSEM/Quiz Assignment/Lab Work & Sessional Marks etc. )
% Attendance Marks Marks
(Theory + Practical) (Max 5 marks) (Max 10 marks)
75% and above 5 10
60-74% 4 8
50-59% 3 6
40-49% 2 4
Below 40% 1 2

DEPARTMENT OF CSE AIML


Page 7
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Rajiv Gandhi Proudhyogiki Vishwavidyalaya, Bhopal


Scheme of Examination as per AICTE Flexible Curricula
III Semester
Bachelor of Technology (B.Tech.)
[Computer Science and Engineering/ Computer Engineering/Computer Science & Technology]
For batches admitted in July, 2020 (w.e.f. Jan, 2022)

DEPARTMENT OF CSE AIML


Page 8
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Programming Practices (c) Python

CSE-Artificial Intelligence and Machine Learning/ Artificial Intelligence and Machine

Learning, III-Semester

AL306 Computer Workshop/Introduction to Python-I

Module1: Introduction to python language, Basic syntax, Literal Constants, Numbers,

Variable and Basic data types,String, Escape Sequences, Operators and Expressions,

Evaluation Order, Indentation, Input, Output, Functions, Comments.

Module2: Data Structure: List, Tuples, Dictionary, DataFrame and Sets, constructing,

indexing, slicing and content manipulation.

Module3: Control Flow:Conditional Statements - If, If-else, Nested If-else. Iterative

Statement - For, While, Nested Loops. Control statements - Break, Continue, Pass.

Module4: Object oriented programming:Class and Object, Attributes, Methods, Scopes

and Namespaces, Inheritance, Overloading, Overriding, Data hiding,Exception:

Exception Handling, Except clause, Try finally clause, User Defined Exceptions.

Module5: Modules and Packages: Standard Libraries: File I/0, Sys, logging, Regular

expression, Date and Time, Network programming, multi-processing and multithreading.


DEPARTMENT OF CSE AIML
Page 9
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

References

 Timothy A. Budd: Exploring python, McGraw-Hill Education.

 R.NageshwarRao ,”Python Programming” ,Wiley India

 Think Python: Allen B. Downey, O'Reilly Media, Inc.

List of Experiments:

1. To write a Python program to find GCD of two numbers.

2. To write a Python Program to find the square root of a number by Newton’s

Method.

3. To write a Python program to find the exponentiation of a number.

4. To write a Python Program to find the maximum from a list of numbers.

5. To write a Python Program to perform Linear Search

6. To write a Python Program to perform binary search.

7. To write a Python Program to perform selection sort.

8. To write a Python Program to perform insertion sort.

9. To write a Python Program to perform Merge sort.

10. To write a Python program to find first n prime numbers.

11. To write a Python program to multiply matrices.

DEPARTMENT OF CSE AIML


Page 10
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

12. To write a Python program for command line arguments.

13. To write a Python program to find the most frequent words in a text read from a

file.

14. To write a Python program to simulate elliptical orbits in Pygame.

15. To write a Python program to bouncing ball in Pygame.

DEPARTMENT OF CSE AIML


Page 11
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Rational

Unit 1
Python is a high-level, interpreted programming language known for its simplicity and readability. It was created by
Guido van Rossum and first released in 1991. Python emphasizes code readability and has a clean and easy-to-learn syn-
tax, which makes it an excellent language for beginners and professionals alike.

Variables and Basic Data Types:

Variables in Python are dynamically typed, meaning you don't have to declare the type explicitly. You can assign any
value to a variableStrings and Escape Sequences:

Strings in Python are enclosed in either single (') or double (") quotes. Escape sequences are used to represent special
characters within strings, such as newline (\n), tab (\t), and backslash (\\).

Operators and Expressions:

Python supports various operators, including arithmetic operators (+, -, *, /, %), comparison operators (==, !=, <, >, <=,
>=), logical operators (and, or, not), and more.

Indentation:

Indentation is crucial in Python to define blocks of code, such as within loops, conditional statements, and function def-
initions. Consistent indentation using spaces or tabs is required, and mixing them can result in errors.

Input Output:

You can take input from the user using the input() function and display output using the print() function.

Functions:

Functions are defined using the def keyword. They allow you to encapsulate reusable pieces of code. Functions can
have parameters and return values.

Comments:

Comments in Python start with the # character and extend to the end of the line. They are used to document code and
improve its readability.

Unit 2

Lists:A list is a mutable, ordered collection of items. Lists are defined using square brackets [] and can contain
elements of different data types. You can modify, add, and remove elements from a

Tuples:A tuple is an immutable, ordered collection of items. Tuples are defined using parentheses () and, like lists, can
contain elements of different data types. However, once a tuple is created, you cannot modify its elements.

Dictionary:A dictionary is an unordered collection of items, consisting of key-value pairs. Dictionaries are defined us-
ing curly braces {} and key-value pairs are separated by colons :.

Sets:
A set is an unordered collection of unique elements. Sets are defined using curly braces {} but without key-value pairs.
You can create a set from a list using the set() function.

DEPARTMENT OF CSE AIML


Page 12
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Unit 3

Conditional Statements:
Conditional statements in Python allow you to execute different blocks of code based on the evaluation of certain con-
ditions.
If Statement:
The if statement is used to execute a block of code if a condition is true.
x = 10
if x > 5:
print("x is greater than 5")
If-else Statement:
The if-else statement allows you to execute one block of code if the condition is true and another block if the condition
is false.
x = 10
if x > 5:
print("x is greater than 5")
else:
print("x is not greater than 5")
Iterative statements allow you to execute a block of code repeatedly.
For Loop:
The for loop is used to iterate over a sequence (such as a list, tuple, or string) or any iterable object.
python
Copy code
for i in range(5):
print(i)
While Loop:
The while loop is used to execute a block of code as long as the condition is true.
x=0
while x < 5:
print(x)
x += 1
Nested Loops:
You can nest loops within each other to perform more complex iterations.
python
Copy code
for i in range(3):
for j in range(3):
print(i, j)
Control Statements:
Control statements allow you to alter the flow of execution within loops or conditional statements.
Break Statement:
The break statement is used to exit the loop prematurely.
for i in range(5):
if i == 3:
break
print(i)
Continue Statement:
The continue statement is used to skip the current iteration and proceed to the next iteration of the loop.
for i in range(5):
if i == 3:
continue
print(i)

DEPARTMENT OF CSE AIML


Page 13
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Pass Statement:The pass statement is a null operation, meaning it does nothing. It can be used as a place-
holder when a statement is syntactically required but you don't want any code to execute.
x = 10
if x > 5:
pass # Do nothing for now
else:
print("x is not greater than 5")
Unit 4:Class and Object:
A class is a blueprint for creating objects. It defines the attributes and behaviors that objects of the class will
have.
An object is an instance of a class. It represents a specific entity with its own unique state and behavior.
class MyClass:
pass
obj = MyClass() # Creating an object of MyClass
Attributes:
Attributes are the properties or characteristics associated with a class or object. They can be variables (data
attributes) or functions (methods).
class Person:
def __init__(self, name, age):
self.name = name # Data attribute
self.age = age # Data attribute
person1 = Person("Alice", 30)
print(person1.name) # Accessing data attribute
Methods:
Methods are functions defined within a class. They define the behavior of objects of the class.
Methods can operate on the object's attributes and modify their state.
class Circle:

def __init__(self, radius):

self.radius = radius

Scopes and Namespaces:


A namespace is a mapping from names to objects. It organizes the names defined within a Python program.
Scopes define the visibility and lifetime of names within a program.
Inheritance:
Inheritance allows a class (subclass) to inherit attributes and methods from another class (superclass).
class Animal:
def speak(self):
print("Animal speaks")
class Dog(Animal): # Dog inherits from Animal
def bark(self):
print("Dog barks")
dog = Dog()
dog.speak() # Accessing method from superclass
Overloading:
Overloading allows a class to define multiple methods with the same name but different parameters or
behaviors.
Overriding:
DEPARTMENT OF CSE AIML
Page 14
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Overriding occurs when a subclass provides a specific implementation of a method that is already
defined in its superclass.
Data Hiding:
Data hiding (encapsulation) is the process of restricting access to certain attributes or methods of a class.
It helps to prevent accidental modification of data and ensures that access to attributes and methods is
controlled.
Unit 5
Exception handling is a crucial aspect of programming to deal with unexpected errors or exceptional situations. Python
provides several constructs for exception handling:
Try-Except Clause:
The try-except block allows you to handle exceptions gracefully by catching and responding to specific types of errors.
try:
x = 10 / 0 # This will raise a ZeroDivisionError
except ZeroDivisionError:
print("Division by zero is not allowed")
Try-Finally Clause:
The try-finally block ensures that certain code (usually cleanup code) runs regardless of whether an exception
try:
file = open("example.txt", "r")
# Perform some operations with the file
finally:
file.close() # This will always execute, even if an exception occurs
User Defined Exceptions:
You can create custom exception classes by subclassing built-in exception classes or the Exception class.

DEPARTMENT OF CSE AIML


Page 15
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Blooms Taxonomy

DEPARTMENT OF CSE AIML


Page 16
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Program Outcomes as defined by NBA (PO)


Engineering Graduates will be able to:

1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering funda-


mentals, and an engineering specialization to the solution of complex engineering problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex engin-
eering problems reaching substantiated conclusions using first principles of mathematics, nat-
ural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consid-
eration for the public health and safety, and the cultural, societal, and environmental considera-
tions.
4. Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of
the information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities
with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant
to the professional engineering practice.
7. Environment and sustainability: Understand the impact of the professional engineering solu-
tions in societal and environmental contexts, and demonstrate the knowledge of, and need
for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the engin-
eering community and with society at large, such as, being able to comprehend and write ef-
fective reports and design documentation, make effective presentations, and give and receive
clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the en-
gineering and management principles and apply these to one’s own work, as a member and
leader in a team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.

DEPARTMENT OF CSE AIML


Page 17
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Program Specific Outcomes (PSO)

At the end of the program, the student


PSO1: An ability to demonstrate technical knowledge of computer science and engineering
fundamentals to become employable in industry.

PSO2: An ability to develop programming skills using modern software tools and techniques.
PSO3: An ability to develop real time projects for problem solving of domains such as Machine

Learning, Cyber security, block chain and big data


PSO4: An ability to grab research, higher studies and entrepreneurship opportunities towards
society with moral values and ethics

Program Educational Objectives (PEO):


PEO 1: Evolve as globally competent computer professionals, researchers and entrepren-
eurs possessing collaborative and leadership skills, for developing innovative solutions in
multidisciplinary domains.
PEO 2: Excel as socially committed computer engineers having mutual respect, effective
communication skills, high ethical values and empathy for the needs of society.
PEO 3: Involve in lifelong learning to foster the sustainable development in the emerging
areas of technology.

DEPARTMENT OF CSE AIML


Page 18
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

LAKSHMI NARAIN COLLEGE OF TECHNOLOGY, EXCELLENCE BHOPAL


Department of Computer Science & Engineering
Course name with B.Tech, Programming Practices
code: AL-306 CODE Session:- JULY-DEC 2024

Course Outcomes (CO's)


Student will be able to
CO406.1 Analyse basic features of python and compare it with other programming language.
CO406.2 Implement primitive and derived data structures with python.
CO406.3 Implement structural and functional programming concept with python.
CO406.4 Implement object oriented programming concept with python.
CO406.5 Illustrate concurrent programming with python.

Course Articulation Matrix


CO/PO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO406.1 3 3 - - - 2 3 - 1 1 1 3
CO406.2 3 3 3 1 - - - - 1 1 1 3
CO406.3 3 3 3 1 - - - - 1 1 1 3
CO406.4 3 3 - - 2 - 2 - 1 1 1 3
CO406.5 3 3 - - 2 2 2 - 1 1 1 3
3 3 3 1 2 2 2.3333 - 1 1 1 3
Program Specific Outcomes (PSO's)
An ability to demonstrate technical knowledge of computer science and engineering fundamentals to be-
PSO1
come employable in industry.

PSO2 An ability to develop programming skills using modern software tools and techniques.

An ability to develop real time projects for problem solving of domains such as Machine learning Cyber
PSO3
security, block chain and big data.
An ability to grab research, higher studies and entrepreneurship opportunities towards society with moral
PSO4
values and ethics.

CO/PSO Matrix
CO/PSO PSO1 PSO2 PSO3 PSO4
CO406.1 - 2 3 3
CO406.2 - 2 3 3
CO406.3 - 2 3 3
CO406.4 - 2 3 3
CO406.5 - 3 3 3
- 2.2 3 3

DEPARTMENT OF CSE AIML


Page 19
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

B.TECH. – III SEMESTER (CSE)

CSE AL-306

List of Experiment

Department COMPUTER SCIENCE & ENGG. Session : 2024-25

Name of Faculty Prof. PAYAL GOVINDANI Semester III

Subject Name Python Sub. Code AL-306

TIME SCHEDULE : Total expected periods -------

Day Monday Tuesday Wednesday Thursday Friday Saturday

Timings --- --- --- --- --- ---

List of Experiment Date Of Implementation


S. No.
Expected date Actual date CO Covered Remark

Lab-1 a. Create variables for storing your C01


name, age, height (in meters), and
whether you are a student. Use appro-
priate data types for each variable.
b. Write a programme to Use literal con-
stants to define the number of days in a
week and the value of pi (accurate to 2
decimal places).
c. Write a programme Create a greeting
message that includes your name and
age. Use escape sequences to include a
newline in the message.
d. Write a programme Ask the user to in-
put their favourite number and their
birth year. Output a message that in-
cludes their favourite number and cal-
culates their age based on the birth
year.
e. Write a programme Compute and dis-
play the area of a circle with a radius
of 5 meters using the formula
area=π×radius2\text{area} = \pi \
times \text{radius}^2area=π×radius2.

DEPARTMENT OF CSE AIML


Page 20
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

a. Write a Python program to check


whether an element exists within a
tuple.

b. Write a Python program to get the


Lab-2 largest number from a list.
CO2

c. Write a Python program to remove an


item from a set if it is present in the
set.

a. Write a Python program that uses


frozensets.
Note: Frozensets behave just like sets
except they are immutable.

b. Write a Python program to create a


dictionary from two lists without
Lab-3
losing duplicate values. CO2
Sample lists: ['Class-V', 'Class-VI',
'Class-VII', 'Class-VIII'], [1, 2, 2, 3]
Expected Output: defaultdict(<class
'set'>, {'Class-V': {1}, 'Class-VI': {2},
'Class-VII': {2}, 'Class-VIII': {3}})

Lab-4 a. Write a Python program to find those CO3


numbers which are divisible by 7 and
multiples of 5, between 1500 and 2700
(both included).

b. Write a Python program to construct


the following pattern, using a nested
for loop.

*
**
***
****
*****
****
***
DEPARTMENT OF CSE AIML
Page 21
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

**
*

c. Write a Python program to convert


temperatures to and from Celsius and
Fahrenheit.
[ Formula : c/5 = f-32/9 [ where c =
temperature in celsius and f =
temperature in fahrenheit ]

a. Write a Python program to check CO3


whether an alphabet is a vowel or
consonant.
Lab-5
b. Write a Python program to check if a
triangle is equilateral, isosceles or
scalene.

CO3
a. Write a Python program to solve the
Fibonacci sequence using recursion.

Lab-6
b. Write a Python program to get the sum of a
non-negative integer using recursion.

a. Write a Python program to check the CO3


validity of passwords input by users.
Validation
b. Write a Python program to find num-
Lab-7 bers between 100 and 400 (both in-
cluded) where each digit of a number
is an even number. The numbers ob-
tained should be printed in a comma-
separated sequence.
c. Write a Python program to convert a
month name to a number of days.
Lab-8 a. Write a Python program to sum two in- CO3
tegers. However, if the sum is between
15 and 20 it will return 20.

b. Write a Python program that checks


DEPARTMENT OF CSE AIML
Page 22
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

whether a string represents an integer


or not.
1. Write a Python program to import a built-in CO4
array module and display the namespace of
the said module.

2. Write a Python program to create a class


Lab-9 and display the namespace of that class.

3. Write a Python program to create an


instance of a specified class and display the
namespace of the said instance.

a. Write a Python program that imports CO4


the abs() function using the builtins
module, displays the documentation of
the abs() function and finds the
absolute value of -155.

b. Define a Python function student().


Using function attributes display the
Lab-10 names of all arguments.

c. Write a Python function student_data


() that will print the ID of a student
(student_id). If the user passes an
argument student_name or
student_class the function will print
the student name and class

Lab-11 CO4

a. Write a Python program to handle a


ZeroDivisionError exception when di-
viding a number by zero.

b. Write a Python program that prompts


the user to input an integer and raises a
ValueError exception if the input is not
a valid integer.

c. Write a Python program that opens a


file and handles a FileNotFoundError

DEPARTMENT OF CSE AIML


Page 23
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

exception if the file does not exist.

CO5
a. Write a Python program to read each row
from a given csv file and print a list of strings.

b. Write a Python program to read a given


Lab-12 CSV file having tab delimiter.

c. Write a Python program to read a given


CSV file as a list.

a. Create a text file named data.txt and C05


write the following lines to it:
Hello, World!
This is a test file.
Python is great for file I/O.

Lab-13 b. Write a Python script that uses the sys


module to:

 Print the command-line arguments


passed to the script.
 Display the Python version in use.

a. Write a Python script that: CO5

 Gets the current date and time.


 Formats the current date as "YYYY-
MM-DD" and time as "HH:MM".
 Calculates the number of days between
Lab-14
today and a given future date (e.g.,
"2025-12-31").

b. Write a Python program to count the


frequency of words in a file.

Prepared by Approved by Issued by

Prof. AYAL GOVINDANI Dr. NEETESH KUMAR GUPTA Dr.A.K.Saxena

DEPARTMENT OF CSE AIML


Page 24
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

Faculty HOD Principal

Rubrics for Assessment of Practical Marks

Practical Per- Either the stu- The student The student The student per- The student per-
formance/ dent is Absent performed al- performed al- formed 75 % of formed 100 %
in all lab ses- most 25 most 50 practical suc- of practical suc-
Teacher’s
sions or per- % of % of cessfully. cessfully.
Assessment
formed less practi- practi-
(10)
than 25% of cal suc- cal suc-
practical or the cess- cess-
performance fully. fully.
was
not successful.
Practical Either the stu- The student’s The student’s The student’s The student’s
Quiz/Assign- dent is Absent score is be- score is be- score is be- score is greater
ment (5) or the response tween 01 to 25 tween 26 to 50 tween 51 to 75 than 75 %.
is not avail- %. %. %.
able/
incomplete.
Attendance (5) Student’s atten- Student’s at- Student’s at- Student’s at- Student’s at-
dance is below tendance is be- tendance is be- tendance is be- tendance is
40 %. tween 40 % tween 50 % tween 60 % 75% and
and and and above.
50 %. 59 %. 74 %.
End Semester Grade F repre- Grade D rep- Grade C + rep- Grade B + rep- Grade A + rep-
Examination sents marks be- resents marks resents marks resents marks resents marks
(100) tween 30 - 0 between 31-40 between 51-60 between 71-80 between 91-
and perfor- and perfor- and perfor- and perfor- 100 and perfor-
 Grade mance is Fail mance is Mar- mance is Aver- mance is Very mance is Out-
 %Marks Grade I repre- ginal age Good standing
range (based sents Incom-
on absolute plete. Grade C rep- Grade B repre- Grade A repre-
marks system) resents marks sents marks be- sents marks be-
Grade W repre-
 Description of between 41-50 tween 61-70 and tween 81-90
sents With-
performance) and perfor- performance is performance is
drawal
mance is Excellent
Satisfactory Good

DEPARTMENT OF CSE AIML


Page 25
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

DEPARTMENT OF CSE AIML


Page 26
LAKSHMI NARAIAN COLLEGE OF TECHNOLOGY EXCELLENCE, BHOPAL

DEPARTMENT OF CSE AIML


Page 27

You might also like