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

+5 votes
asked Nov 19 by Eric Sanders (170 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 6 days ago by xDELLx (4,800 points)
edited 4 days ago 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.
...