0% found this document useful (0 votes)
48 views4 pages

Python Programming Lab Syllabus 2024-25

The document outlines the syllabus for the Python Programming Lab course for I Year B. Tech. II semester students, detailing course outcomes and modules covering fundamental programming concepts, data structures, functions, and file handling. It includes practical exercises and a case study project, along with reference books and web resources for further learning.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views4 pages

Python Programming Lab Syllabus 2024-25

The document outlines the syllabus for the Python Programming Lab course for I Year B. Tech. II semester students, detailing course outcomes and modules covering fundamental programming concepts, data structures, functions, and file handling. It includes practical exercises and a case study project, along with reference books and web resources for further learning.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

R24- Syllabus of CSE-GVPW(A) w.e.f.

2024-25

PYTHON PROGRAMMING LAB


I Year B. Tech. II semester
[Common to CSE, CSE (AI&ML), IT]

L T P C
Course Code: 24CT11RC07
0 0 3 1.5

Course Outcomes: At the end of the Course, the student shall be able to:
CO1: Understand core programming basics and various Operators of Python. (L2)
CO2: Implement programs using conditional statements and loops and strings. (L3)
CO3: Develop functions and strings to perform simple tasks. (L3)
CO4: Make use of various data structures like lists, tuples, sets and dictionaries. (L3)
CO5: Implement Python programs with files, Classes and objects. (L3)

Module-1: Basics of Python


1. Write a program to display the statements.
2. Demonstrate about fundamental Data types in Python Programming. (i.e., int, float, complex, bool and
string types)
3. Write a Python program to demonstrate various type conversion functions.
4. Write a program to demonstrate the inbuilt Math function

Module-2: Operators in Python


1. Demonstrate the following Operators in Python with suitable examples.
i) Arithmetic Operators ii) Relational Operators
iii) Assignment Operators iv) Logical Operators
v) Bit wise Operators vi) Ternary Operator
vii) Membership Operators viii) Identity Operators

Module-3: Conditional Branching Statements


1. Write a program to check whether the given number is even or odd
2. Write a program to read marks of a student and display the corresponding grade
3. Write a program to find the largest element among the given numbers (multi-way if-elif-else statements.)

Module-4: Looping/Iterative Statements


1. Implement the following programs using while loop and for loop
i. Display all prime numbers up to n. ii. Print the nth multiplication table.
iii. Print different patterns using loops:

Page 45 of 53
R24- Syllabus of CSE-GVPW(A) w.e.f.2024-25

2. Demonstrate the following control transfer statements in Python with suitable examples.
i. break ii. continue iii. Pass

Module-5: Functions
1. Write a function to find the multiplication of two numbers and demonstrate the usage of parameters and
arguments of a function.
2. Write a program to define a function using default arguments.
3. Demonstrate lambda functions in Python with suitable example programs.

Module-6: Strings
1. Write a program to manage and analyse customer feedback using string operations include:

i. Create feedback with name, email, comment ii. Collecting feedback.


iii. Normalizing feedback (e.g., removing extra spaces, converting to lowercase).
iv. Extracting key in formation (e.g., names, email addresses, and comments).
v. Searching for keywords. vi. Replacing certain words.
vii. Formatting feedback for display. viii. Summarizing feedback.

Module-7: Lists:
1. Write a program to create a list and perform the following operations:
i. + ii. * iii. slicing iv. del
2. Inventory Management: You have a list of items in your warehouse along with their quantities. Write a
program to find out which items are low in stock (quantity less than 10). (use only comprehensions)
3. Employee Performance: You have a list of employee names and their corresponding performance scores.
Write a program to sort the list based on the performance scores in descending order.
4. Sales Analysis: you have a list of sales figures for the past week. Write a program to find the total sales,
the highest sale, the lowest sale, and the average sale.
5. Write a program to calculate the length of each element in a list using map function in python.

Module-8: Tuples
1. Write a program to return the top n’s most frequently occurring chars and their respective counts. e.g.
string=aaaaaabbbbcccc, n=2 should return [(a 6) (b 4)].
2. Write a program to create n iterables of varied sizes and group the values using zip function in python.
3. Student Information: Write a program to create a list of tuples where each tuple contains the student ID,
name, and grade and find the student with the highest grade.

Page 46 of 53
R24- Syllabus of CSE-GVPW(A) w.e.f.2024-25

4. Course Enrolment: Write a program to create list of tuples where each tuple contains the course ID and
the number of students enrolled and find the total number of students enrolled across all courses
5. Faculty Information: Write a program to create a list of tuples where each tuple contains the faculty ID,
name, and department and find all faculty members in a given department.
6. Library Book Tracking: You have a list of tuples where each tuple contains the book ID, title, and number
of copies available. Write a program to find all books with fewer than 5 copies available.

Module-9: Sets & Dictionaries


1. Write a program to create two sets and perform the following operations:
i. Union ii. Intersection iii. Difference iv. Asymmetric Difference
2. Write a program to generate a dictionary that contains numbers (between 1 and n) in the form of (x,x*x).
3. Write a program to implement a shopping cart where you can add items with their prices and quantities,
and then calculate the total cost.
4. Banking System: Write a program to create dictionary with customer name and balance and retrieve the
balance for a given customer, deposit a specified amount into a customer's account, Withdraw a specified
amount from a customer's account if sufficient balance is available, Transfer a specified amount from one
customer's account to another's and Remove a customer from the bank's system.

Module-10: Classes and objects


1. Create a class to represent menu items in a restaurant with attributes like name, price, and category.
Implement methods to display menu details and calculate the total cost of a selected list of items.
2. Write a program to read 3 subject marks and display pass or failed using class and object.

Module-11: Files
1. Write a program to copy the contents of a file to another file.
2. Write a program to compute the number of characters, words and lines in a file.

Case Study:
Select any one application mentioned below
Note: A report has to be submitted by every student at the end of the semester that includes design, coding,
output, etc.

1. Design a Python program to manage inventory, process orders, and handle customer information for an
online store.
2. Create a library system to track books, manage member accounts, and handle book loans and returns.
3. Implement a personal finance management tool to track income, expenses, and generate monthly reports.
4. Create a system to manage student grades, calculate GPAs, and generate academic reports.

Page 47 of 53
R24- Syllabus of CSE-GVPW(A) w.e.f.2024-25

5. Develop a Python-based movie recommendation system using collaborative filtering.


6. Build a to-do list application that allows users to add, update, delete, and prioritize tasks..
7. Build a patient management system to handle appointments, medical records, and billing.
8. Design a digital menu for a restaurant with options for ordering, bill generation, and inventory
management.
9. Implement a fitness tracking application to log workouts, track progress, and suggest exercise plans.
10. Build a secure online voting platform with user authentication and vote tallying.
11. Create a program to manage recipes, including ingredients, instructions, and nutritional information.
12. Build a travel planning application to manage itineraries, bookings, and budget tracking.
13. Develop an e-learning application with course creation, student enrolment, and progress tracking.
14. Build a car rental management system to handle bookings, returns, and vehicle maintenance.
15. Build a budget planning application to track expenses, income, and financial goals.
16. Develop a cryptocurrency tracking application to monitor prices, market trends, and portfolio
performance.

Reference Books:
1. Python Programming: Using Problem Solving Approach by Reema Theraja , Oxford publications
2. Ashok N Kamthane, Amit Ashok Kamthane, Programming and Problem Solving with Python, 1st Edition,
McGraw Hill Education (India), 2018.

Web References:
1. [Link]
2. [Link]
3. [Link]
4. [Link]

Page 48 of 53

Common questions

Powered by AI

Using Python classes to represent menu items in restaurant management software provides a structured and scalable approach to encapsulating related data and operations, such as name, price, and category. This object-oriented design allows for reusability and abstraction, where each item can have methods to compute costs and display information efficiently. However, the main limitations include increased initial complexity due to object-oriented principles which might be excessive for simple menu applications. Moreover, over-abstraction can lead to maintenance difficulties if not done judiciously .

Tuples in Python offer several advantages over lists when storing structured data. Firstly, they are immutable, which means the data cannot be altered once defined, providing a layer of data integrity and security. This immutability also allows tuples to be used as keys in dictionaries, a use case not supported by lists. Additionally, tuples generally have a smaller memory footprint and faster access time compared to lists, due to their immutability. This makes tuples ideal for storing heterogeneous, structured data that doesn't require modification .

Python's built-in type conversion functions, such as int(), float(), str(), list(), and tuple(), facilitate datatype management by allowing programmers to convert values from one datatype to another as required by the application's logic. This functionality is essential for ensuring data compatibility and manipulating data effectively within the program, such as converting user input strings to integers for arithmetic operations .

List comprehensions provide a more concise and readable approach to filtering data than traditional loops. They allow for the creation of a new list by applying an expression to each item in a sequence that satisfies a specified condition, all in a single line of code. This reduces the need for multiple lines of code and temporary variables, thus improving efficiency and reducing the likelihood of errors. Moreover, list comprehensions are optimized for performance, generally resulting in faster execution compared to equivalent loops .

Asymmetric set differences in Python are used to identify elements present in one set but not in another, using either the difference method or the '-' operator. This operation is particularly useful in data processing for filtering out unwanted data entries. For example, isolating data elements present in a current dataset but missing in a previous snapshot can be efficiently achieved via set differences, aiding in detecting changes or new additions. This method exemplifies Python's capacity to facilitate data comparison tasks concisely .

Bitwise operators in Python are used to perform bit-level operations on integers. They involve operations like AND (&), OR (|), XOR (^), NOT (~), and bit shifts (<<, >>). For instance, the expression 'a & b' performs a bitwise AND operation on each pair of corresponding bits of a and b. A practical example is flipping the switch on a specific bit in a bitmap to toggle features on or off, using operations like a bitwise OR to set a bit or a bitwise AND with a negated mask to clear a bit .

The zip function in Python combines multiple iterable datasets, pairing elements from each by corresponding positions into tuples. This is particularly useful for datasets where correlation between elements is required. For instance, pairing student names, scores, and grades into tuples allows for organized management and analysis of student data. The zip function simplifies operations that would otherwise require manual index management, efficiently iterating over multiple sequences simultaneously .

Dictionaries in Python are highly suitable for implementing a simple banking system due to their ability to store pairs of data (key-value), where names or customer IDs can be keys, and balances are values. This allows for efficient retrieval and update operations, such as checking balances, depositing, and withdrawing amounts via quick lookups. Furthermore, dictionaries support updates and deletions, necessary for maintaining dynamic banking data, and handle operations like adding new customers or removing old ones with ease .

Lambda functions in Python offer a concise way to write small, unnamed functions inline. They are particularly useful for short, throwaway functions that are not meant to be reused elsewhere in the code. A common application is in functional programming paradigms where functions like map(), filter(), and sorted() can take a lambda function as an argument to perform operations directly on data collections. For example, 'sorted(list_of_tuples, key=lambda x: x[1])' sorts a list of tuples based on the second element of each tuple .

In Python, multi-way if-elif-else statements can be effectively used to classify data by evaluation against a series of conditions. This decision-making structure allows for the expression of complex condition chains where different actions are taken based on satisfied conditions. For example, classifying student grades: if the score is above 90, assign an 'A', elif it is between 80 and 89, assign a 'B', and so on. This approach enhances code clarity and logic flow by clearly delineating actions or categories based on defined criteria .

You might also like