n = input('Enter your choice : ').split()
lista = list(n)
while True:
comand = input('Your command : ')
if comand == 'show':
lista.sort()
if comand == 'add':
lista.append(input())
if comand == 'remove':
lista.pop()
if comand == 'terminate':
break
print(lista)
Try this code, it is working..
Actually in your code "lista" was not getting updated, so take it outside while loop.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
n = input('Enter your choice : ').split()
lista = list(n)
while True:
comand = input('Your command : ')
if comand == 'show':
lista.sort()
if comand == 'add':
lista.append(input())
if comand == 'remove':
lista.pop()
if comand == 'terminate':
break
print(lista)
Try this code, it is working..
Actually in your code "lista" was not getting updated, so take it outside while loop.