m = "y" # do this to ask if you want to condinue or not
while m =="y":
print("Choose 1 for Append")
print("Choose 2 for insert")
print("Choose 3 for append a list to a another list")
print("Choose 4 to modify element")
print("Choose 5 to delete a existing element with given value")
print("Choose 6 to delete a existing element with a given element")
ch=int(input("Enter your choice"))
ne=int(input("Enter the number of elements to be entered"))
l1=[]
for i in range(ne):
el=input("Enter the element")
l1.append(el)
print(l1)
if ch ==1:
el2 = input("ENter the element to be appended")
l1.append(el2)
print(l1)
elif ch==2:
el3 = input("Enter the element to be inserted ")
p1 = int(input("Enter the position "))
l1.insert(p1,el3)
print(l1)
elif ch==3:
l2 = input("Enter the list to be appended")
l1.append(l2)
print(l1)
elif ch==4:
i=int(input("Enter index of element to modify"))
el4=input("Enter the new value")
l1[i]=el4
print(l1)
elif ch==5:
i2 = int(input("Enter the index of the element to be deleted"))
del l1[i2]
print(l1)
elif ch==6:
el5 = input("Enter the element to be deleted")
l1.remove(el4)
print(l1)
else:
print("Invalid choice")
m = input("Do you want to it again, y/n") # do this to ask if you want to condinue or not....!
Click Run or press shift + ENTER to run code