Professional Documents
Culture Documents
KENDRIYA VIDYALAYA
KHANAPARA
PROJECT REPORT
ON
1
TABLE OF CONTENTS
2
ACKNOWLEDGEMENT
We would like to express our sincere gratitude to all those who have
contributed to the successful completion of this computer science
project.
First and foremost, I would like to thank our computer science teacher
Dr. Vimal Kumar Soni for providing valuable guidance and support
throughout the project. Your insights and feedback were instrumental in
shaping the direction of our work.
Last but not least, we are grateful to the entire school community for
fostering an environment that encourages exploration and learning. The
resources and opportunities provided have been crucial in the
development and execution of this project.
Thank you to everyone who played a role in this endeavor. Your support
has been invaluable, and we are truly grateful for the collaborative spirit
that made this project a success.
3
CERTIFICATE BY GUIDE
The report is the result of his/her/their consistent efforts and endeavors. The
report is found worthy of acceptance as final project for the subject
COMPUTER SCIENCE (083) of Class XII Session 2023-24.
PM SHRI KV KHANAPARA
4
5
CERTIFICATE BY EXAMINER
Examiner
6
INTRODUCTION TO THE
PROJECT
This project is basically made for the management of:
Phone contacts
ABOUT PYTHON:
Python is an interpreted, object-oriented, high-level programming
language with dynamic semantics. It's high-level built- in data
structures, combined with dynamic typing and dynamic binding,
makes it very attractive for Rapid Application Development, as well
as for use as a scripting or glue language to connect existing
components together. Python's simple, easy to learn syntax
emphasizes readability and therefore reduces the cost of program
maintenance. Python supports modules and packages, which
encourages program modularity and code reuse. The Python
interpreter and the extensive standard library are available in source or
binary form without charge for all major platforms, and can be freely
distributed.
9
DETAILS OF
FUNCTIONALITIES /FEATURES
OF THE PROJECT
1.Add contact
2.Change the phone number of the contact
3.Delete a contact
4.Display all contacts
5.Display all contacts in sorted manner
6.check whether a contact exist
10
PROJECT SPECIFICATIONS
6. ‘input’: This function is used to take user input from the console.
contact_details
11
PROJECT CODE
import mysql.connector
cursor = conn.cursor()
12
def delete_contact(name):
cursor.execute("DELETE FROM contacts WHERE name = %s", (name,))
if cursor.rowcount > 0:
conn.commit()
print("Contact deleted")
else:
print("No contact found with this name")
def display_contacts():
cursor.execute("SELECT * FROM contacts")
rows = cursor.fetchall()
if rows:
for row in rows:
print(row[0], row[1])
else:
print("No contacts found")
def display_sorted_contacts():
cursor.execute("SELECT * FROM contacts ORDER BY name")
rows = cursor.fetchall()
if rows:
for row in rows:
print(row[0], row[1])
else:
print("No contacts found")
def check_contact(name):
cursor.execute("SELECT phone FROM contacts WHERE name = %s",
(name,))
row = cursor.fetchone()
if row:
print("Phone number:", row[0])
else:
print("No contact found with this name")
while True:
print("""
1. Add contact
2. Change the phone number of a contact
3. Delete a contact
4. Display all contacts
5. Display all contacts in sorted order
13
6. Check whether a contact exists
7. Exit
""")
choice = int(input("Enter a choice: "))
if choice == 1:
name = input("Enter a name of the friend: ")
phno = int(input("Enter the phone number of the friend: "))
add_contact(name, phno)
elif choice == 2:
name = input("Enter the contact name whose phone number to be changed:
")
phno = int(input("Enter the new phone number: "))
change_phone_number(name, phno)
elif choice == 3:
name = input("Enter the name of the contact to be deleted: ")
delete_contact(name)
elif choice == 4:
display_contacts()
elif choice == 5:
display_sorted_contacts()
elif choice == 6:
name = input("Enter the name to be searched: ")
check_contact(name)
elif choice == 7:
conn.close()
break
else:
print("Invalid option selected")
#code over
OUTPUT
14
Main menu
To delete a contact
15
To display all contacts
16
CONCLUSION
17
The project, “Phone Contact Management”
system is just one example of using technology for
a better cause. Phone contact management is not
an easy task as huge scale of data has to be
stored and processed.Data processing is a tiring
job.Humans alone cannot manage and process
such huge data.
Through this project, we developed a
better understanding of python and its modules .It
helped us to brush up certain concepts of python
which we learned in class 11 and 12.This project
gave a clear idea of real life applicability of python
and solve real life problems.
BIBLIOGRAPHY
18
Websites:
1.https://www.w3schools.com/python/python_intro.asp
2. https://www.python.org/about/gettingstarted/
3 https://www.learnpython.org/
4.https://stackoverflow.blog/2021/07/14/getting-started-with-python
Books:
19