list1 = [4,5,6,7,1]
#Do you code below
flag = True
while flag == True:
print('The elements in the list is %s'%list1)
ans = input('Do you want to add value to it ( y / n)?')
if ans.lower() == 'y':
ele = input('Enter the element you need to add ..')
list1.append(ele)
elif ans.lower() == 'n':
flag = False
print('The final elements contain in list are %s'%list1)