Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
60 views2 pages

cc104 Activity2 Prog

The document describes a Python program that demonstrates array operations. The program allows the user to add elements to an empty array, delete elements from the array, search for elements in the array, print all elements of the array, and exit the program. Based on the user's input, the program will perform the corresponding array operation, prompt messages to the user, and continue looping until the user chooses to exit.
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)
60 views2 pages

cc104 Activity2 Prog

The document describes a Python program that demonstrates array operations. The program allows the user to add elements to an empty array, delete elements from the array, search for elements in the array, print all elements of the array, and exit the program. Based on the user's input, the program will perform the corresponding array operation, prompt messages to the user, and continue looping until the user chooses to exit.
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/ 2

CC 104

Array Operation

Write a program that demonstrate the array operations in Python.


Note:
 Program Name: LastNameFirstName_ArrayOperation.py
 Create an empty array.
 Prompt “Array is empty” if no elements in the array.
 The program continues to loop unless Exit is selected.
 If the inputted
Program Output:

If 1 is selected, add new element in the array

If 2 is selected, delete an element in the array.

 If the element to delete not in the array, prompt message “Element not in the list”

If 3 is selected, search an element in the array.


If element is the list, prompt a message.
CC 104
Array Operation

If element is not the list, prompt a message

If 4 is selected, print the elements in the array.

If 5 is selected, terminate the program.

If no, the program will continue to loop.

You might also like