Computer Science Assignment
Session 2023-24
ON THE TOPIC:
Anglo-Bodo Dictionary in Python
Submitted to:
Mam Sarojini Basumatary
Submitted by:
Veeshal D. Bodosa, Roll No: 35
Hanti Narzary, Roll No: 16
Hrishikesh Bhowmick, Roll No: 18
Class: XII (Science)
Don Bosco H.S. School Kokrajhar
CERTIFICATE
This is to certify that Veeshal D. Bodosa, Hanti Narzary and
Hrishikesh Bhowmick are students of Class: XII (Science) of
Don Bosco H.S. School for the Academic Year 2023-24. They
have successfully completed their Assignment on the topic
“Anglo-Bodo Dictionary in Python” as per prescribed by
Mam Sarojini Basumatary and in accordance with the
guidelines issued by CBSE.
….….………….. …..….………….
Teacher’s Signature Principal’s Signature
…………………….
School Seal
2|Page
ACKNOWLEDGEMENT
We would like to express our sincere gratitude to our
Computer Science Teacher, Mam Sarojini Basumatary, for
her vital support, guidance, and encouragement. Without her
help, this project would not have been possible. Her
suggestions and instructions have significantly contributed to
the successful outcome of this project.
We take this opportunity to thank our Head of the
Institution, Rev. Fr. Ignatious K. Sangma who has always
been supportive and helpful in fulfilling all our academic
requirements.
Additionally, we would like to express our gratitude to our
friends for their valuable suggestions and timely assistance.
3|Page
CONTENT
Title Page
⎆ Aim of the Project 5
⎆ Action Plan 6
⎆ Introduction 7
⎆ Code 8
⎆ Output 11
⎆ 1. Add Word 11
⎆ 2. Display Word 11
⎆ 3. Search Word 12
⎆ 4. Delete Word 12
⎆ 5. Exit the Program 12
⎆ Conclusion 13
⎆ Bibliography 14
4|Page
AIM OF THE PROJECT
The aim of this project is to create an Anglo-Bodo
Dictionary using Python, highlighting efficient file handling,
dictionary data structures, and user-friendly features.
Additionally, a MySQL database name ‘dictionary’ has been
utilized, with the table named ‘dictionaryword’.
The system enables users to manage Bodo words, including
English Word, Pronunciation, Parts of Speech, Bodo
Meaning, English Meaning, and Example, by offering
essential operations such as adding, displaying, searching,
and deleting records.
5|Page
ACTION PLAN
During the Puja Break, we were provided with an
assignment outline and detailed project information. We
chose the topic “Anglo-Bodo Dictionary in Python” and
conducted further research on it.
We gathered information from the internet and books,
combined it, and prepared a draft. After making some
modifications, we obtained approval from the teacher, and
the project was completed.
6|Page
INTRODUCTION
Anglo-Bodo Dictionary is a Python-based menu-driven
program designed to efficiently manage and maintain
dictionary records. The application utilizes a MySQL
database name ‘dictionary’, with a table named
‘dictionaryword’, to store and retrieve data.
The system allows users to perform various operations,
including adding new dictionary words, displaying existing
words, searching for specific word, and deleting unwanted
words. It stores information such as English Word,
Pronunciation, Parts of Speech, Bodo Meaning, English
Meaning, and Example.
The project aims to showcase essential programming
concepts such as file handling, dictionaries, user input, and
conditional statements. With a user-friendly interface, it
serves as a practical example of an Anglo-Bodo Dictionary.
7|Page
CODE
# DESIGNED BY VEESHAL, HANTI $ HRISHIKESH
import mysql.connector as sqltor
# Connect to the database
mycon = sqltor.connect(
host="localhost",
user="root",
passwd="",
database="dictionary")
# Check if the connection is successful
if mycon.is_connected():
print("\nDESIGNED BY VEESHAL, HANTI $ HRISHIKESH")
# Function to add a new entry to the dictionary
def add_entry(english_word, ringsharthi, parts_of_speech, bodo_meaning,
english_meaning, example):
cursor = mycon.cursor()
sql = "INSERT INTO dictionaryword (engWord, ringsharthi, parts_of_speech,
bodo_meaning, meaning, example) VALUES (%s, %s, %s, %s, %s, %s)"
values = (english_word, ringsharthi, parts_of_speech, bodo_meaning,
english_meaning, example)
cursor.execute(sql, values)
mycon.commit()
cursor.close()
print("\nEntry added successfully!")
# Function to search for a word in the dictionary
def search_word(english_word):
cursor = mycon.cursor()
sql = "SELECT * FROM dictionaryword WHERE engWord = %s"
cursor.execute(sql, (english_word,))
result = cursor.fetchone()
cursor.close()
if result:
print("\nSearch Result:")
8|Page
print("\nEnglish Word:", result[1])
print("Pronunciation:", result[2])
print("Parts of Speech:", result[3])
print("Bodo Meaning:", result[4])
print("English Meaning:", result[5])
print("Example:", result[6])
else:
print("\nWord not found in the dictionary.")
# Function to display all records in the dictionary in ascending order by English
Word
def display_records():
cursor = mycon.cursor()
sql = "SELECT * FROM dictionaryword ORDER BY engWord ASC"
cursor.execute(sql)
results = cursor.fetchall()
cursor.close()
if not results:
print("\nNo records found.")
else:
print("\nDictionary Records:")
for row in results:
print("\nEnglish Word:", row[1])
print("Pronunciation:", row[2])
print("Parts of Speech:", row[3])
print("Bodo Meaning:", row[4])
print("English Meaning:", row[5])
print("Example:", row[6])
# Function to delete a record by English Word
def delete_record(english_word):
cursor = mycon.cursor()
sql = "DELETE FROM dictionaryword WHERE engWord = %s"
cursor.execute(sql, (english_word,))
mycon.commit()
cursor.close()
print(f"\nRecord with English Word '{english_word}' deleted successfully!")
9|Page
# Menu loop
while True:
print("\nAnglo Bodo Dictionary Menu:")
print("\n1. Add Record")
print("2. Display Record")
print("3. Search Record")
print("4. Delete Record")
print("5. Exit")
choice = input("\nEnter your choice : ")
if choice == '1':
english_word = input("\nEnter English Word: ")
ringsharthi = input("Enter Pronunciation (Ringsharthi): ")
parts_of_speech = input("Enter Parts of Speech: ")
bodo_meaning = input("Enter Bodo Meaning: ")
english_meaning = input("Enter English Meaning: ")
example = input("Enter Example: ")
add_entry(english_word, ringsharthi, parts_of_speech, bodo_meaning,
english_meaning, example)
elif choice == '2':
display_records()
elif choice == '3':
english_word = input("\nEnter English Word to search: ")
search_word(english_word)
elif choice == '4':
english_word = input("\nEnter English Word to delete: ")
delete_record(english_word)
elif choice == '5':
print("\nExiting the program.")
break
else:
print("\nInvalid choice. Please enter a valid option.")
# Close the database connection
mycon.close()
10 | P a g e
OUTPUT
1. Add Record
2. Display Record
11 | P a g e
3. Search Record
4. Delete Record
5. Exit
12 | P a g e
CONCLUSION
In conclusion, the Anglo-Bodo Dictionary project is a well-
structured and practical application that effectively
combines Python Programming with a MySQL database to
create a user-friendly and efficient dictionary management
system. The project successfully achieves its primary goal of
enabling users to manage Bodo words by providing essential
features like adding, displaying, searching, and deleting
dictionary words.
The utilization of Python showcases key programming
concepts, including file handling, dictionary data structures,
user input handling, and conditional statements, making it
an educational resource for those learning Python.
This project can serve as a valuable reference for anyone
interested in developing similar applications or working with
Python and databases. Overall, the Anglo-Bodo Dictionary
project is a successful example of a Python-based
application with a clear and well-defined purpose, making it
a noteworthy contribution to the field of programming and
language-related applications.
13 | P a g e
BIBLIOGRAPHY
Website:
⎆ https://chat.openai.com
Book:
⎆ Dhanpat Rai Publications, Computer Science with
Python Textbook Class 12, ISBN-13: 9788177002362,
ISBN-10: 8177002368
14 | P a g e