0% found this document useful (0 votes)
3 views13 pages

Cs Project

The document is a project file for a Computer Science course submitted by Ansh Pandey for the academic year 2024-2025. It includes a certificate of completion, acknowledgments, a program for a menu-driven Python application that manipulates a list, and an output section. The program allows users to perform various operations on a list, such as appending, inserting, modifying, and deleting elements.

Uploaded by

pandeyrajesh156
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views13 pages

Cs Project

The document is a project file for a Computer Science course submitted by Ansh Pandey for the academic year 2024-2025. It includes a certificate of completion, acknowledgments, a program for a menu-driven Python application that manipulates a list, and an output section. The program allows users to perform various operations on a list, such as appending, inserting, modifying, and deleting elements.

Uploaded by

pandeyrajesh156
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

COMPUTER SCIENCE

PROJECT FILE
2024-25
PM SHRI Kendriya Vidyalaya
NO.1 A.F.S
SECTOR-14 GURUGRAM
(HARYANA)
COMPUTER SCIENCE
PROJECT
Submitted by: ANSH PANDEY (XI-G)
INDEX

CERTIFICATE
ACKNOWLEGMENT
INTORDUCTION
PROGRAM
OUTPUT
CERTIFICATE

This is to certify that ANSH PANDEY of


class XI ‘G’ has satisfactorily completed
his Computer Science on the topic MENU
DRIVEN PYTHON PROGRAM as prescribed
by the CBSE during the academic year
2024-2025.
ACKNOWLEDGEMENT
I would like to express my immense gratitude
to my chemistry teacher Mr. DEVINDER SIR
for the help and guidance he provided for
completing this project.

I also thank my parents who gave their


ideas and inputs in making this project.
Most of all I thank our school
management, for providing us the
facilities and opportunity to do this
project.

Lastly, I would like to thanks my


classmates who have done this project
along with me. Their support made this
project fruitful.
ANSH PANDEY 11thG
PROGRAM
myList = [] #myList already has 5
elements
choice = 0
while True:
print("The list 'myList' has the
following elements", myList)
print("\nL I S T O P E R A T I O N S")
print(" 1. Append an element")
print(" 2. Insert an element at the
desired position")
print(" 3. Append a list to the given
list")
print(" 4. Modify an existing
element")
print(" 5. Delete an existing element
by its position")
print(" 6. Delete an existing element
by its value")
print(" 7. Sort the list in ascending
order")
print(" 8. Sort the list in descending
order")
print(" 9. Display the list")
print(" 10. Exit")
choice = int(input("ENTER YOUR
CHOICE (1-10): "))
if choice == 1:
element = int(input("Enter the
element to be appended: "))
myList.append(element)
print("The element has been
appended\n")
elif choice == 2:
element = int(input("Enter the
element to be inserted: "))
pos = int(input("Enter the
position:"))
myList.insert(pos,element)
print("The element has been
inserted\n")
elif choice == 3:
newList = eval(input( "Enter the
elements separated by commas"))
myList.extend(list(newList))
print("The list has been appended\
n")
elif choice == 4:
i = int(input("Enter the position of
the element to be modified: "))
if i < len(myList):
newElement = int(input("Enter the
new element: "))
oldElement = myList[i]
myList[i] = newElement
print("The
element",oldElement,"has been
modified\n")
else:
print("Position of the element is
more than the length of list")
elif choice == 5:
i = int(input("Enter the position of
the element to be deleted: "))
if i < len(myList):
element = myList.pop(i)
print("The element",element,"has
been deleted\n")
else:
print("\nPosition of the element is
more than the length of list")
elif choice == 6:
element = int(input("\nEnter the
element to be deleted: "))
if element in myList:
myList.remove(element)
print("\nThe element",element,"has
been deleted\n")
else:
print("\nElement",element,"is not
present in the list")
elif choice == 7:
myList.sort()
print("\nThe list has been sorted")
elif choice == 8:
myList.sort(reverse = True)
print("\nThe list has been sorted in
reverse order")
elif choice == 9:
print("\nThe list is:", myList)
elif choice == 10:
break
else:
print("Choice is not valid")
print("\n\nPress any key to
continue..............")
ch = input()
OUTPUT

You might also like