Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Trying to add, edit, and delete an element(s)

+8 votes
asked Nov 19, 2020 by Eric Sanders (200 points)
def Transactions():
    Transactions = [5,7,9,11]
def getselection():
    print ("====Main Menu====")
print ("1. Display Transactions:")
print ("2. Add a new transaction:")
print ("3. Remove a transaction:")
print ("4. Edit a current transaction:")
print ("9. Exit Main Menu...")
selection = getselection()
def return_selection():
    return_selection
while True:
    print ("\n")
if (selection==1):
    Display()
def Add():
    def transaction():
        transaction = input("enter a trasaction key")
    Transactions.append(trasaction)    
if (selection==2):
    Add(13)
def delete():
    delete = input("enter transaction to delete:")
if delete in Transactions:
    num = Transactions.index(delete)
del [5]
else:
    print(5,"was not found in list")

1 Answer

0 votes
answered Nov 20, 2020 by xDELLx (7,630 points)
edited Nov 22, 2020 by xDELLx

Can you please attach the code in the "formatted" version.

The code above doesnt make sense & will be wasting time to re formatt it .

Screen shot for refernce : https://ibb.co/tJdvRKv

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...