Python Programming
Python Programming
2024-25
PYTHON PROGRAMMING
II Year B. Tech. I semester
[Skill Course: ECE]
L T P C
Course Code: 24EC11SC01
1 0 2 2
Course Outcomes: At the end of the Course, the student shall be able to
CO1: Understand core programming basics and various Operators of Python.
CO2: Implement programs using conditional statements and loops and strings.
CO3: Develop functions and strings to perform simple tasks.
CO4: Make use of various data structures like lists, tuples, sets and dictionaries.
CO5: Implement Python programs with files, Classes and objects.
List of Experiments
Introduction to Python:
Identifiers and Keywords, Strings, Comparing Strings, Slicing and Striding Strings, String Operators
and Methods, Tuples, Lists, Sets, dictionaries, Iterating and copying collections
Python Library Modules: random, math, os, shutil, sys, creating a custom module
Page 19 of 43
R24- Syllabus of ECE-GVPW(A) w.e.f.2024-25
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.)
4. Implement the following programs using while loop and for loop
i. Display all prime numbers up to n. ii. Print the nth multiplication table.
5. Demonstrate the following control transfer statements in Python with suitable examples.
Module-4: 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.
iv. Extracting key in formation (e.g., names, email addresses, and comments).
Module-5: Lists:
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. Write a program to calculate the length of each element in a list using map function in python.
Page 20 of 43
R24- Syllabus of ECE-GVPW(A) w.e.f.2024-25
Module-6: 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.
1. Write a program to create two sets and perform the following operations:
2. Write a program to implement a shopping cart where you can add items with their prices and
quantities, and then calculate the total cost.
3. 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-8: Functions
1. Write a function to find the multiplication of two numbers and demonstrate the usage of
parameters and arguments of a function.
4. Write a Python program that asks the user to input two numbers and divides the first number
by the second. Your program should handle the following exceptions:
Page 21 of 43
R24- Syllabus of ECE-GVPW(A) w.e.f.2024-25
1. Write a Python program to generate and print a random number between 1 and 100.
2. Write a Python program to calculate and print the square root of a number, for example, 64.
3. Write a Python program to display the sine and cosine values of 45 degrees, and also print the
value of π using the math module.
4. Write a Python program to list all the files and folders in the current working directory.
5. Write a Python program to create a new folder called test_folder. If it already exists, display a
message saying the folder already exists.
6. Write a Python program to copy a file named source.txt to a new file called destination.txt.
7. Write a Python program to move a file named file_to_move.txt into a folder named new_folder.
8. Write a Python program to print the current Python version and the system path list using the
sys module.
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.
Case Study:
Note: A report has to be submitted by every student at the end of the semester by choosing any one of the
following case studies:
Build a program to add, view, update, and delete student records, calculate grades, search by name/ID,
handle input errors, and save/load data using files.
Create an inventory manager to add products, check low stock, generate bills, calculate totals, and store
bills using classes and file handling.
3. Feedback Analyzer
Design a tool to collect and clean customer feedback, search and replace keywords, count word/character
frequency, and manage data through files.
Page 22 of 43
R24- Syllabus of ECE-GVPW(A) w.e.f.2024-25
Develop an application to create and manage accounts, handle deposits, withdrawals, transfers, and balance
checks with proper validation and file support.
A basic program where users can input daily expenses, view summaries by category, calculate totals, and
store data in files for future use.
6. Contact Book
Create a contact manager to add, view, search, and delete contacts using names, phone numbers, and
emails, with data stored in dictionaries and files.
A simple application to manage tasks—add, mark as done, delete, and view tasks using lists and string
operations, with optional save/load functionality.
8. Simple Calculator
Build a basic calculator that performs arithmetic operations, handles invalid inputs using exception
handling, and provides a clean menu-driven interface.
9. Grade Calculator
Create a program that takes marks for multiple subjects, calculates total and average, determines grade
using conditions, and supports multiple student entries.
An application that generates strong random passwords based on user input for length and character types
(letters, numbers, symbols), using built-in modules and string handling.
Reference Books:
Web References:
1. https://archive.nptel.ac.in/courses/106/106/106106212/
Page 23 of 43