Data Analytics Using Python Longterm Internship (Anitha)
Data Analytics Using Python Longterm Internship (Anitha)
On
DATA ANALYTICS USING PYTHON
Submitted to the Department of Computer Science
By
GINJALA ANITHA
III BCA
CERTIFICATE
This is to certify that The Long Term Internship entitled, “Data
Analytics using Python” is a bonified work of GINJALA
ANITHA, bearing 231177401045, III BCA, submitted to the
Department of Computer Science, Aditya Degree College, Tuni
for the Academic Year 2023-2026.
Principal
Mrs. M.N.V.G.A. Deepthi, [Link], (Ph.D)
Place: Tuni
Date:07/03/2026
ADITYA DEGREE COLLEGE
Department of Computer Science
[Link] , [Link]
ACKNOWLEDGEMENT
No endeavour is completed without the valuable support of others. I would like to take this opportunity to
extend my sincere gratitude to all those who have contributed to the successful completion of this Long-
Term Internship Project Report.
It is privilege to thank [Link] REDDY, Chairman Sir,Aditya group of institutions for providing state-
ofthe-Art facilities, experienced and talented faculty members.
It is privilege to thank Dr. N. SUGUNA REDDY, Secretary Madam, Aditya group of institutions for
providing Long-Term Internship Project Report from Adhoc.
I thank [Link] Sir, Academic Director, Aditya Degree College for his continuous support and
encouragement in my endeavour.
At this juncture I feel deeply honoured in expressing my sincere thanks to CEngg Daniel Benjamin Sir,
Chartered Engineer, AMIE, [Link], Project Director, CEO Devika Pakruthi Mam of Adhoc Network
Tech Company,India and Canada for making the resources available at right time and providing valuable
insights leading to the successful completion of my Long-Term Internship Project Report.
We extend our heartfelt thanks to [Link], MTech our Technical Trainer, for his exceptional
contribution throughout this internship. His dedication, innovative approach, and ability to make sessions
both interactive and insightful have truly enhanced the learning experience for all our students.
We sincerely appreciate his strong technical expertise, clarity in teaching, and his unwavering
commitment to ensuring that each student gained the best possible understanding
I express my deep sense of gratitude to Mrs. [Link], [Link], (Ph.D.), Principal, For
her Efforts and for giving us permission for carrying out this Long-Term Internship.
I thank [Link] , [Link], Head of the Department of Bachelor of Computer Science, Aditya
Degree College-Vizianagaram, for supporting and encouraging me in completion of my Long-Term
Internship.
Finally I thank all the faculty members of our Department who contributed their valuable suggestions in
completion of Long-Term Internship report and I also put my sincere thanks to My Parents who stood with
me during the whole Long-Term Internship.
GINJALA ANITHA
ABOUT ADITYA DEGREE COLLEGES
Aditya Degree colleges are the precious gifts presented to the twin Godavari Districts by
ADITYA. Educational group ADITYA Degree College which was established in 1998 in
Kakinada fulfilled the hopes and aspirations of many graduates and had been acclaimed as
the best degree college under Andhra University. Encouraged by the 100% result in
2003,ADITYA added several feathers to its cap by launching Degree Colleges in
Rajahmundry in 2003, in Vizag and Palakol in 2005 and in Tatipaka in 2006.
Needless to say, in the present scenario girls excel more than boys in education and they give
tough competition to boys. Owing to their diffidence and inhibition, girls find difficulty in
expressing their doubts in a classroom of Co-ed College. Moreover, parents have many
objections in sending their daughters to a co-ed college. Realizing this, ADITYA successfully
leads Degree colleges for girls to prove their talents in curricular, co-curricular and extra-
curricular activities. ADITYA started P.G College also for Women to encourage them for
higher education.
VISION
To provide inclusive education with innovative methods and strenuous efforts for inculcating
human values, professionalism and scientific instillation in the realm of Degree Education to
all sections of students irrespective of race, region and religion with special focus to stand
independently and to emerge as centre for Research and Development.
MISSION
To provide ample scope for multifaceted development of local youth.
To provide quality higher education to student community.
To Recruit Highly Qualified and Experienced Faculty to provide Quality Education.
ABOUT ADHOC NETWORK TECH COMPANY
● Innovation
● Excellence
● Collaboration
● Integrity
● Customer Centricity
● Continuous Learning
GINJALA ANITHA
TABLE OF CONTENTS
Abstract …………………………………………………………………………...11 - 12
Introduction………………………………………………………………………..13 - 15
Existing System…………………………….…………………………………….. 16 - 17
Propsed System……………………………………………………………………18 - 19
System Requirements…………………………………………………………….. 20 - 21
Implementation…………………………………………………………………... 22 - 79
Project Source Code…………………………………………………………….... 80 - 83
Outputs……………………………………………………………….…………... 84 - 90
Conclusion……………………………………………………………...………... 91 – 92
ABSTRACT
ABSTRACT
11
The Digital Lost and Found Management System is a web-based application
developed to manage lost and found items through a centralized digital
platform. The system allows users to register and log in securely to report
lost items or post details of found items along with images and contact
information. The backend of the application is developed using Python with
the Flask framework, and it stores item details in a structured database for
easy management. Users can browse items, delete posts, and mark items as
found after successful recovery. The application is designed with a
responsive user interface so that it works efficiently on both mobile devices
and laptops. Overall, this system reduces manual effort, improves the
chances of recovering lost belongings, and provides a simple, efficient, and
user-friendly digital solution for lost and found management.
12
INTRODUCTION
13
INTRODUCTION
Overview
In today’s rapidly growing digital world, technology has become an essential part of
everyday life. People frequently travel, study, and work in crowded environments such as
colleges, universities, offices, shopping malls, railway stations, and public events. In
such places, losing personal belongings like mobile phones, wallets, ID cards, laptops,
documents, jewelry, and bags is very common. Recovering these lost items through
traditional manual methods is often difficult and time-consuming. Many times, even if
someone finds a lost item, there is no proper way to inform the rightful owner. This
creates inconvenience and frustration for both parties.
The traditional lost and found management process mainly depends on manual registers,
verbal communication, or physical notice boards. These methods are not well organized
and lack proper documentation. There is no centralized system to track lost or found
items efficiently. As a result, the recovery rate of lost items becomes very low. Therefore,
a digital system is necessary to manage lost and found items in a structured, secure, and
efficient manner.
The need for the Digital Lost and Found Management System arises due to several
limitations in the existing manual process. Firstly, manual record keeping is prone to
errors and mismanagement. There is no guarantee that the information written in
registers will be maintained properly. Secondly, communication gaps between the person
who lost the item and the person who found it reduce the chances of recovery.
In many institutions such as colleges and offices, there is no dedicated system to handle
lost and found items. People depend on informal communication, which is not reliable.
Additionally, manual methods consume more time and effort. There is also a possibility
14
Project Objectives
The main objectives of the Digital Lost and Found Management System are:
• To develop a centralized digital platform for managing lost and found items.
• These objectives focus on providing a reliable and practical solution for handling
lost and found cases effectively.
15
EXISTING SYSTEM
16
EXISTING SYSTEM
The existing lost and found system is mostly manual and relies on notice boards, verbal
announcements, and paper registers. When someone loses an item, they inform security
or staff, and found items are also reported the same way. There is no centralized
database, and records can be misplaced or damaged. Searching for a specific item
manually is timeconsuming and inefficient. Communication between the person who lost
the item and the person who found it is weak, reducing recovery chances. Manual
records are prone to errors and duplications. Users cannot access lost items remotely or
online. The system requires constant monitoring by staff, consuming time and effort.
Recovery chances of lost items are low, and managing multiple items is difficult.
Overall, the manual system is slow, unreliable, and lacks proper organization, which
makes a digital solution necessary.
17
‘
PROPOSED SYSTEM
18
PROPOSED SYSTEM
The proposed system is a Digital Lost and Found Management System that provides a
centralized platform to manage lost and found items efficiently. Users can register and
log in securely to access the system. After logging in, they can post details of lost or
found items, including item name, description, date, location, contact information, and
images. All data is stored in a structured database, making it easy to retrieve and manage
information. Users can browse items, search for lost belongings, and mark items as
found once recovered. The backend is developed using Python with Flask, and the
frontend is designed using HTML, CSS, and Bootstrap. The system is responsive and
works on both laptops and mobile devices. It reduces manual effort, saves time, and
improves communication between users. Proper authentication ensures data security and
reliability. Overall, the proposed system is efficient, user-friendly, and provides a
practical solution for managing lost and found items digitally.
19
SYSTEM REQUIREMENTS
20
System Requirements
Hardware Requirements:
Software Requirements:
21
IMPLEMENTATION
22
IMPLEMENTATION
PROJECT-01
OUTPUT:-
23
PROJECT-02
OUTPUT:
PROJECT-03
24
Title: Write a python program to create a list of 4fruits and print first & last
item:
OUTPUT:-
PROJECT-04
25
Title: Write a python program asking user to enter a city and check if it
exists in the tuple:-
OUTPUT:-
26
PROJECT-05
Title: Write a python program to update dictionary values using user input:
OUTPUT:-
27
PROJECT-06
OUTPUT:
28
PROJECT-07
OUTPUT:
29
PROJECT-08
OUTPUT:-
30
PROJECT-09
print("Relational Operator")
a=20
b=6
print("Value of a =", a)
print("Value of b =", b)
print("a == b:", a == b)
print("a != b:", a != b)
print("a > b:", a > b)
print("a > b:", a < b)
print("a >= b:", a >= b)
print("a <= b:", a <= b)
OUTPUT:
28
PROJECT-10
OUTPUT:-
29
PROJECT-11
Title: Write a python program implementing identity operators:-
x = 100
z = 100
print("Small integers:")
print("x =", x, ", z =", z)
print("x == z:", x == z)
print("x is z:", x is z)
print()
a = 2000
b = 2000
print("Large integers:")
print("a =", a, ", b =", b)
print("a == b:", a == b)
print("a is b:", a is b)
print()
c = [1]
d = [1]
print("Lists with 1 element:")
print("c =", c, ", d =", d)
print("c == d:", c == d)
print("c is d:", c is d)
OUTPUT:-
30
PROJECT-12
OUTPUT:-
31
PROJECT-13
OUTPUT:-
32
PROJECT-14
age = 17
is_student = True
movie_type = "3D"
day = 6
print("------- MOVIE TICKET BILLING SYSTEM -------")
if age >= 18:
print("Status: Adult")
print("--------------------------------------------")
if age < 18:
base_price = 200
else:
base_price = 30
print("Base Ticket Price:", base_price)
print("--------------------------------------------")
if movie_type == "Normal":
extra = 0
elif movie_type == "3D":
extra = 150
elif movie_type == "IMAX":
extra = 300
else:
extra = 0
print("Extra Charges for", movie_type, ":", extra)
print("--------------------------------------------")
discount = 0
if age > 18:
if is_student:
discount = 100
print("Student Discount Applied: ₹50")
else:
if is_student:
discount = 150
print("Student Discount Applied: ₹70")
print("--------------------------------------------")
special_offer = "Eligible for Weekend Offer" if day >= 6 else "Weekday –
No Offer"
print("Offer Status:", special_offer)
print("--------------------------------------------")
match day:
case 1:
32
print("Today is Monday")
case 2:
print("Today is Tuesday")
case 3:
print("Today is Wednesday")
case 4:
print("Today is Thursday")
case 5:
print("Today is Friday")
case 6:
print("Today is Saturday")
case 7:
print("Today is Sunday")
case _:
print("Invalid Day")
print("--------------------------------------------")
final_amount = (base_price + extra) - discount
print("🎟 Final Ticket Price: ₹", final_amount)
Output:
33
PROJECT-15
num = 7
for i in range(1,11):
print(num,"x",i,"m",num*i)
OUTPUT :
34
PROJECT-16
OUTPUT :
35
PROJECT-17
order_list = []
choice = "yes"
while choice == "yes":
item= input("Enter item name:")
order_list.append(item)
choice = input("Add more items? (yes/no):")
print("\nYour Final order:")
for item in order_list:
print(item)
print("Thank you for ordering!")
OUTPUT :
35
ROJECT-18
OUTPUT :
36
PROJECT-19
OUTPUT:
37
PROJECT-20
Title: Write a Python program to skip employees with no assigned task
using the pass statement.
OUTPUT :
38
PROJECT-21
Title: Write a python program to Calculate Total Bill Amount using
functions.
OUTPUT :
39
PROJECT-22
Title: Give a tuple of IT courses with duplicate values, create a new
tuple containing only unique courses while maintaining order.
it_courses = ("Python", "Java", "Python", "Web", "Java", "Cloud")
unique_courses = []
for course in it_courses:
if course not in unique_courses:
unique_courses.append(course)
unique_courses = tuple(unique_courses)
print(unique_courses)
Output:
PROJECT-23
40
Title : Write a python program on list operations:
v_list=["Apple","Banana","Cherry","Dragonfruit","Grapes","Iceapple","jac
kfruit","kiwi","lemon","Mango",]
v_list.append("guava")
print(v_list)
v_list.extend(["orange"])
print(v_list)
v_list.remove("Dragonfruit")
print(v_list)
v_list.sort()
print(v_list)
v_list.insert(4,"Papaya")
print(v_list)
v_list.pop()
print(v_list)
v_list.copy()
print(v_list)
v_list.reverse()
print(v_list)
OUTPUT:
PROJECT-24
41
Title : Write a python program for tuple operations:
st_name=("Jaya", "Anitha", "Kusuma", "Anusha", "Janu")
b=list(st_name)
[Link]("Durga")
print(tuple(b))
[Link]("Anitha")
print(tuple(b))
[Link](3,"Ramu")
print(tuple(b))
[Link]()
print(tuple(b))
[Link](2)
print(tuple(b))
[Link]()
print(tuple(b))
[Link](["Rani"])
print(tuple(b))
OUTPUT :
42
PROJECT-25
t1=("c","java","python")
(core_course,full_stack,programming_languages)=t1
print(core_course)
print(full_stack)
print(programming_languages)
t1=("c++","java","python")
(core_course,full_stack,programming_languages)=t1
print(core_course)
print(full_stack)
print(programming_languages)
t1=("c++","java","python")
t2=("html","css")
t3=t1+t2
print(t3)
OUTPUT :
43
PROJECT-26
"Name":"adhoc",
"Id":123,
"Location":"Vizag",
"Work_mode":"Chennai",
"Team_work":30,}
print(company)
print(company["Name"])
print([Link]("id"))
print([Link]())
print([Link]())
company["Name"]="Cognizant"
company["Project_status"]="active"
OUTPUT :
44
PROJECT-27
college={
"Name":"Aditya degree college",
"Section":"BCA-A",
"Strength":55,}
[Link]({"Strength":70})
print(college)
[Link]("Strength")
print(college)
[Link]()
print(college)
mycollege=[Link]()
print(mycollege)
[Link]()
print(college)
OUTPUT :
45
PROJECT-28
set={"Anitha","Uma","Pavani"}
for x in set:
print(x)
[Link]("kusuma")
print(set)
[Link]("kusuma")
print(set)
[Link]("Uma")
print(set)
[Link]("Pavani")
print(set)
[Link](["prasanthi","bharathi"])
print(set)
[Link]()
print(set)
[Link]()
print(set)
OUTPUT :
46
PROJECT-29
s = frozenset({"A","B","C"})
print(type(s))
a={1,2,3,4,5,6,0,}
b={1,2,3,4,5,6,7,8,}
c=a|b
print(c)
d=a&b
print(d)
e=a-b
print(e)
f=a^b
print(f)
print([Link](b))
print([Link](b))
OUTPUT :
47
PROJECT-30
Title : Write a Python program and Remove Outliers.
data = [10, 12, 15, 18, 20, 100, 105, 17, 16]
lower_limit = 12
upper_limit = 20
clean_data = []
for x in data:
if x >= lower_limit and x <= upper_limit:
clean_data.append(x)
print("Data after removing outliers:", clean_data)
OUTPUT:
48
PROJECT-31
Title : Write a Python program using Z-Score Method
Output:
49
TASKS
50
TASK-01
name = "Anitha"
course = " Bachelor Computer Applications"
college_name = "Aditya College"
favorite_subject = "python"
roll_no = 106
print("Name:", name)
print("Course:", course)
print("College Name:", college_name)
print("Favorite Subject:", favorite_subject)
print("Roll No:", roll_no)
OUTPUT:
TASK-02
51
Title:Change the value of your favorite subject to something
new and print it again.
favorite_subject = "Java"
print("\nUpdated Favorite Subject:", favorite_subject)
OUTPUT:
TASK-03
52
Title:Create two variables Name and Surname Swap their values
without using a third variable. Print before and after swapping.
Name = "Anitha"
Surname = "Jaya"
print("\nBefore Swapping:")
print("Name:", Name)
print("Surname:", Surname)
Name, Surname = Surname, Name
print("\nAfter Swapping:")
print("Name:", Name)
print("Surname:", Surname)
OUTPUT:
TASK-04
53
Title: Create the following variables and print their values and their
data types using type():
x = 25
y = 3.14
name = "Python"
is_active = True
items = ["pen", "book", "scale"]
student = {"name": "Anitha", "age": 20}
marks = (90, 85, 92)
unique_ids = {101, 102, 103}
print("x =", x, "Type:", type(x))
print("y =", y, "Type:", type(y))
print("name =", name, "Type:", type(name))
print("is_active =", is_active, "Type:", type(is_active))
print("items =", items, "Type:", type(items))
print("student =", student, "Type:", type(student))
print("marks =", marks, "Type:", type(marks))
print("unique_ids =", unique_ids, "Type:", type(unique_ids))
OUTPUT:
TASK-05
54
Title: Create a list named numbers with values: [5, 10, 15, 20, 25] Do
the following:
• Print the first element, last element, and the length of the list.
• Add the number 30 using append() and remove 10 using remove().
• Print the final list.
numbers = [5, 10, 15, 20, 25]
print("\nFirst element:", numbers[0])
print("Last element:", numbers[-1])
print("Length of list:", len(numbers))
[Link](30)
[Link](10)
print("Final list:", numbers)
OUTPUT:
TASK-06
55
Title: Create a tuple named student_info with the values: ("Name",
Year, "BSC CS", "Vizag") Students must:
• Print the first and last elements.
• Print the length of the tuple.
• Check whether "Vizag" is present in the tuple and print the result.
• Convert the tuple into a list, add a new score of 80, then convert it
back into a tuple.
student_info = ("Name", "Year", "BCA-A", "Vizag")
print("\nFirst element:", student_info[0])
print("Last element:", student_info[-1])
print("Length of tuple:", len(student_info))
print("Is 'Vizag' present?", "Vizag" in student_info)
student_info_list = list(student_info)
student_info_list.append(80)
student_info = tuple(student_info_list)
print("Updated tuple:", student_info)
OUTPUT:
TASK-07
56
Title: Create a dictionary named student: student = { "name": "Ravi",
"age": 21, "course": "BSC-CS", "city": "Vizag" }
• Print the name and course using their keys.
• Update the city to "Hyderabad".
• Add a new key "year": 3 to the dictionary.
• Print the updated dictionary.
student={
“name”: ”Raju”,
“age”: 26,
“course”: “BSC”,
“city”: “vizag”
}
Print(“\nName:”,student[“name”])
Print(“Course:”, student[“course”])
student[“city”]=Hyderbad”
student[“year”]=3
print(Updated dictionary:”, student)
OUTPUT:
TASK-08
57
Title: Create a set named cities: cities = {"Vizag", "Hyderabad",
"Delhi", "Mumbai", "Vizag"}
• Print the set and observe what happened to the duplicate "Vizag."
• Add a new city called "Chennai" to the set.
• Remove "Delhi" from the set using remove().
• Print the final set.
TASK-09
58
Title: Take three student marks and print the total average marks.
a=int(input())
b=int(input())
c=int(input())
Avg=(a+b+c)/3
print(Avg)
OUTPUT:
TASK-10
59
Title: A warehouse maintains an inventory list: inventory =
[“TV”,”Laptop”,”Mouse”,”Keyboard”,”Mouse”,”Speaker”] Write a
python program to:
• Remove only one duplicate item (“Mouse”)
• Insert “Router” after “Laptop”
• Add multiple new items: “Printer” and “Camera”
• Remove the last item shipped
• Create a copy of inventory for records Print:
• Final inventory list
• Inventory record copy
inventory=["TV", "Laptop", "Mouse", "Keyboard", "Mouse", "Speaker"]
[Link]("Mouse")
[Link]("Laptop")
pos=[Link]("Laptop")
[Link](pos+1,"Router")
[Link](["Printer", "Camera"])
[Link]()
inventory_record=[Link]()
print("Final Inventory:", inventory)
print("Inventory Record:", inventory_record)
OUTPUT:
TASK-11
60
Title: Title: A teacher student marks in a list: marks =
[45,78,32,90,56,32,88] Write a Python program to:
• Remove one failed student mark (below 35)
• Add a new student mark 67
• Create a backup copy of the updated marks
• Sort the marks in ascending order
• Reverse the list to get rank offer (highest first)
Print:
• Final marks list
• Backup copy
for m in marks:
if m<35:
[Link](m)
break
[Link](67)
backup_marks=[Link]()
[Link]()
[Link]()
OUTPUT:
TASK-12
61
TITLE: Objective: Create a salary slip generator that calculates
various components of an employee's salary using arithmetic
operations and stores the results in a dictionary.
Question: Write a Python program that:
1. Takes basic pay as input (float)
2. Calculates HRA as 10% of basic pay
3. Calculates DA as 5% of basic pay
4. Deducts PF of ₹1200
5. Calculates net salary
6. Stores all details in a dictionary
7. Displays the salary slip
basic_pay = float(input("Enter Basic Pay: "))
hra = 0.10 * basic_pay
da = 0.05 * basic_pay
net_salary = basic_pay + hra + da - pf
salary_slip = {
'Basic': basic_pay,
'Allowances': hra + da,
'Deductions': pf,
'Net Salary': net_salary
}
print("Salary Slip Details:", salary_slip)
OUTPUT:
TASK-13
62
Title: Objective: Implement an e-commerce cart system that calculates
the total bill including taxes.
Question: Write a Python program that:
1. Takes prices of 3 items as input (float)
2. Stores them in a list
3. Calculates subtotal
4. Calculates 18% GST on subtotal
5. Calculates final bill
6. Displays cart items, tax amount, and total payable
TASK-14
63
Title: Objective: Create a movie ticket booking system with age
verification and seat availability check.
Question: Write a Python program that:
1. Has a tuple of available seat types
2. Takes user's age as input
3. Takes seat choice as input
4. Checks if user is 18+ AND chosen seat is available
5. Displays booking status
available_seats = ("Standard", "Premium", "VIP")
age = int(input("Enter your age: "))
seat_choice = input("Enter seat type (Standard/Premium/VIP): ")
booking_success = (age >= 18) and (seat_choice in available_seats)
print(f"Booking Request for {seat_choice}:")
print("Booking Successful?", booking_success)
OUTPUT:
TASK-15
64
TITLE: Objective: Implement a system to manage unique user IDs
using set operations.
Question: Write a Python program that:
1. Maintains a set of registered IDs
2. Takes new ID as input
3. Checks if ID already exists
4. Adds new ID to set (if not duplicate)
5. Displays whether ID was duplicate and updated database
registered_ids = {101, 102, 103, 104}
new_id = int(input("Enter new User ID to register: "))
id_exists = new_id in registered_ids
print("ID already existed?", id_exists)
if not id_exists:
registered_ids.add(new_id)
print("Updated Database:", registered_ids)
OUTPUT:
TASK-16
65
TITLE: Objective: Create a system to validate returned books in a
library.
Question: Write a Python program that:
1. Maintains a list of library catalog books
2. Takes returned book name as input
3. Checks if book exists in catalog
4. Displays validation result
library_catalog = ["Plsql", "Python", "Java", "The Hobbit"]
returned_book = input("Enter the name of the book returning: ")
is_valid = returned_book in library_catalog
print(f"Is '{returned_book}' a valid library book?", is_valid)
OUTPUT:
TASK-17
66
TITLE: Objective: Determine student pass/fail status based on strict
criteria. Question: Write a Python program that:
1. Takes theory and practical marks as input
2. Checks if both subjects have ≥40 marks
3. Displays individual subject status
4. Displays final pass status
theory_marks = int(input("Enter Theory Marks: "))
practical_marks = int(input("Enter Practical Marks: "))
theory_cleared = theory_marks >= 40
practical_cleared = practical_marks >= 40
print("Theory Cleared:", theory_cleared)
print("Practical Cleared:", practical_cleared)
final_pass_status = theory_cleared and practical_cleared
print("Final Pass Status:", final_pass_status)
OUTPUT:
TASK-18
67
TASK_NO: 18 TITLE: Objective: Manage warehouse inventory using
assignment operators.
Question: Write a Python program that:
1. Initializes inventory dictionary
2. Takes new stock received as input
3. Takes sold stock as input
4. Updates inventory using += and -= operators
5. Displays final stock
inventory = {"Laptop": 50, "Mouse": 100}
print("Initial Stock:", inventory)
laptops_received = int(input("Enter laptops received: "))
laptops_sold = int(input("Enter laptops sold: "))
inventory["Laptop"] += laptops_received
inventory["Laptop"] -= laptops_sold
print("Final Stock Record:", inventory")
OUTPUT:
TASK-19
68
TITLE: Objective: Convert Indian Rupees to US Dollars using
arithmetic operations.
Question: Write a Python program that:
1. Takes amount in INR as input
2. Uses conversion rate of 1 USD = 83 INR
3. Calculates USD amount
4. Displays both amounts
inr_amount = float(input("Enter amount in INR: "))
conversion_rate = 8
usd_amount = inr_amount / conversion_rate
print("Amount in INR:", inr_amount)
print("Amount in USD:", usd_amount)
OUTPUT:
TASK-20
69
TITLE: Objective: Verify guest identity using identity operators.
Question: Write a Python program that:
1. Compares ID cards using identity operators
2. Demonstrates identity vs equality
3. Checks if user card matches admin card
4. Shows comparison results
guestA_card = "ID_999"
guestB_card = "ID_999"
user_card = input("Enter your ID Card Code: ")
admin_card = "ID_999"
print("Do Guest A and Guest B have identical ID objects?", guestA_card is
guestB_card)
print("Is User Input the same object as Admin Card?", user_card is
admin_card)
OUTPUT:
TASK-21
70
TITLE: Objective: Calculate BMI and determine health status.
Question: Write a Python program that:
1. Takes weight (kg) and height (m) as input
2. Calculates BMI using formula: weight / (height²)
3. Checks if BMI is between 18.5 and 24.9
4. Displays BMI and health status
weight = float(input("Enter weight (kg): "))
height = float(input("Enter height (m): "))
bmi = weight / (height ** 2)
is_healthy = 18.5 <= bmi <= 24.9
print("Calculated BMI:", bmi)
print("Is Healthy Weight?", is_healthy)
OUPUT:
TASK-22
71
TITLE: You need to write a program that:
• Takes the price of a pen
• Takes the price of a notebook
• Takes the quantity of pens
• Takes the quantity of notebooks
Calculates:
1. Total pen cost (price * quantity)
2. Total notebook cost
3. Total bill (pen total + notebook total
pen_cost=20
Book_cost=50
No_of_pens=50
No_of_Books=500
Total_Cost_pens=pen_cost*No_of_pens
Total_Cost_Books=Book_cost*No_of_Books
Total=Total_Cost_Books+Total_Cost_pens
print(Total_Cost_pens)
print(Total_Cost_Books)
print(Total)
OUTPUT:
TASK-23
72
TITLE: Write a program that uses assignment operators to update the
score step-by-step using the following rules:
Start with score = 50
1. Add 20 bonus points using +=
2. Subtract 10 points because the player hit a trap using =
3. Multiply the score by 2 because of a power-up using *= After each
step, print the updated score.
Score=100
Score +=60
print(Score)
Score -=40
print(Score)
Score *=3
print(Score)
OUTPUT:
TASK-24
73
TITLE: You have marks of two students:• mark1• mark2
Your program should: Check and print the result of each comparison:
1. mark1 > mark2
2. mark1 < mark2
3. mark1 == mark2
4. mark1 != mark2
5. mark1 >= mark2
6. mark1 <= mark2 This uses all comparison operators in a practical,
readable way.
mark1=98
mark2=80
print(mark1 > mark2)
print(mark1 < mark2)
print(mark1 == mark2)
print(mark1 != mark2)
print(mark1 >= mark2)
print(mark1 <= mark2)
OUTPUT:
TASK-25
74
TITLE: Imagine a room with two switches:
• Switch A • Switch B
The light turns ON only:
1. Switch A is ON or Switch B is ON
2. But not both at the same time (it’s a weird electrical setup)
Write a program that:
1. Takes two inputs from the user: "on" or "off" for switch A "on" or
"off" for switch B
2. Convert them into booleans: A = (Switch_A = "on") B = (Switch_B =
"on")
3. Use only logical operators to check the light condition: light_on = (A
or B) and not (A and B)
4. Print whether the light is ON or OFF.
switch_a= input("Enter state for Switch A (on/off): ").lower()
switch_b= input("Enter state for Switch B (on/off): ").lower()
A = (switch_a== "on")
B = (switch_b == "on")
light_on = (A or B) and not (A and B)
if light_on:
print("The light is ON.")
else:
print("The light is OFF.")
OUTPUT:
TASK-26
75
TITLE: Creates two lists:
a = [1, 2, 3] b = [1, 2, 3]
c=a
Use identity operators only to check: • a is b • a is c • b is not c Print the
results.
a = [1, 2, 3]
b = [1, 2, 3]
c=a
print(a is b)
print(a is c)
print(b is not c)
OUTPUT:
TASK-27
76
TITLE: Imagine a mini library shelf: books = ["Python", "Java", "C",
"HTML", "CSS"] Write a program that:
1. Takes a book name from the user.
2. Use only membership operators to check:
• book in books
• book not in books
a=["PYTHON","HTML","C","PHP"]
print("C" in a)
print("HTML" not in a)
OUTPUT:
TASK-28
77
TITLE: You are developing a user access management module for a
software system.
Each user has: role
access_level status
Create a dictionary named user_access with the following key–value
pairs:
• role→"Tester"
• access_level→"Limited"
• status→"Active" Update the dictionary to reflect a role change:
• Change role to "Developer"
• Change access_level to "Full" Check the user’s status:
• If status is "Inactive" ,
Remove the access_level key from the dictionary.
Add a new key to track updates:
• last_updated→"2025-01-01"
Display the final contents of the user_access dictionary
user_access={"role":"Tester","access_level":"Limited","status":"Active"}
user_access["role"]="Developer"
user_access["access_level"]="Full"
if user_access["status"]=="Inactive":
user_access.pop("access_level")
user_access["last_updated"]="2025-01-01"
print(user_access)
OUTPUT:
78
MINI PROJECT
MINI PROJECT
Title : Do a mini Project on House Price Prediction using Data
79
Analytics using Python
# ==============================
# HOUSE PRICE PREDICTION
# ==============================
# Import required libraries
import pandas as pd
import numpy as np
import [Link] as plt
import seaborn as sns
# Create Dataset
data = {
'Area': [1200,1500,1800,2000,2200,2500,2700,3000,3200,3500,
1100,1400,1600,1900,2100,2400,2600,2900,3100,3400],
'Bedrooms': [2,3,3,4,4,4,5,5,5,6,
2,3,3,4,4,4,5,5,5,6],
'Bathrooms': [2,2,3,3,3,4,4,4,5,5,
1,2,2,3,3,4,4,4,5,5],
'Floors': [1,2,2,2,2,2,3,3,3,3,
1,1,2,2,2,2,3,3,3,3],
'Price': [3000000,4500000,5500000,6500000,7000000,
8500000,9000000,10000000,11000000,12000000,
2800000,4000000,5000000,6200000,6800000,
8200000,8800000,9800000,10800000,11800000]
}
df = [Link](data)
print([Link]())
# Dataset Information
print([Link]())
80
print([Link]())
# Check Missing Values
print([Link]().sum())
# Data Visualization
[Link](figsize=(6,4))
[Link](df['Price'], kde=True)
[Link]("House Price Distribution")
[Link]()
# Area vs Price
[Link](figsize=(6,4))
[Link](df['Area'], df['Price'])
[Link]("Area")
[Link]("Price")
[Link]("Area vs Price")
[Link]()
# Bedrooms vs Price
[Link](figsize=(6,4))
[Link](df['Bedrooms'], df['Price'])
[Link]("Bedrooms")
[Link]("Price")
[Link]("Bedrooms vs Price")
[Link]()
# Correlation Heatmap
[Link](figsize=(6,4))
[Link]([Link](), annot=True, cmap='coolwarm')
[Link]("Correlation Matrix")
[Link]()
# Define Features and Target
X = df[['Area','Bedrooms','Bathrooms','Floors']]
y = df['Price']
# Split Data
81
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42)
# Train ML Model
from sklearn.linear_model import LinearRegression
model = LinearRegression()
[Link](X_train, y_train)
# Predict House Prices
predictions = [Link](X_test)
print(predictions)
# Model Evaluation
from [Link] import mean_absolute_error, r2_score
mae = mean_absolute_error(y_test, predictions)
r2 = r2_score(y_test, predictions)
print("Mean Absolute Error:", mae)
print("R2 Score:", r2)
# Actual vs Predicted chart
[Link](figsize=(6,4))
[Link](y_test, predictions)
[Link]("Actual Price")
[Link]("Predicted Price")
[Link]("Actual vs Predicted Price")
[Link]()
# Predict New House Price
import pandas as pd
# Create dataframe for new house using same columns as training data
new_house = [Link]([[1800, 3, 2, 2]], columns=[Link])
# Predict the price
predicted_price = [Link](new_house)
# Display predicted price
print("Predicted House Price:", predicted_price[0])
82
83
OUTPUTS
OUTPUTS
84
85
86
87
88
89
PROJECT SOURCE CODE
90
PROJECT SOURCE CODE
*”Business & Sales Analytics*”
- Restail Store Performance Comparison- Compare sales, footfall, and
conversion rates across different store locations.
# Load dataset
df = pd.read_csv("retail_sales_data.csv")
91
[Link]("Month")
[Link]("Revenue")
[Link]()
92
[Link]("Store Location")
[Link]("Revenue")
[Link]()
93
OUTPUTS
94
OUTPUTS
95
96
97
98
99
CONCLUSION
100
CONCLUSION
The Retail Store Performance Comparison project successfully
demonstrates how data analysis can be used to gain valuable insights into
multi-store operations and customer behavior across different locations. By
analyzing sales and operational data from several retail outlets, the project
identified important patterns such as top-performing stores, best-selling
product categories, peak shopping hours, and overall revenue trends. These
insights help retailers better understand regional customer preferences,
allocate resources more effectively, and make informed strategic decisions
for each [Link] Python and data analysis libraries such as Pandas,
Matplotlib, and Seaborn, the dataset was cleaned, processed, and visualized
efficiently.
The analysis involved merging transactional data with store and product
information, calculating key performance indicators (KPIs) like sales per
square foot and average basket value, and comparing these metrics across
different stores and time periods. Through these techniques, the project
highlighted which stores consistently outperformed others, which locations
required operational improvements, and which product lines drove the most
revenue.
The study also revealed important time-based trends, such as peak billing
hours, weekday versus weekend performance, and seasonal fluctuations in
demand. Understanding these patterns allows retailers to improve staff
scheduling, optimize inventory distribution between stores, refine
promotional strategies for specific regions, and enhance overall customer
service. Ultimately, the Retail Store Performance Comparison project
illustrates how data-driven decision-making can support continuous
performance improvement and drive sustainable growth across a retail
network.
101