Python code:
PeoplesNames = []
while len(PeoplesNames) < 3:
person = input('Enter your name: ')
PeoplesNames.append(person)
print PeoplesNames
if 'Dan' in PeoplesNames:
PeoplesNames.pop('Dan')
print PeoplesNames
From my understanding this should run through the while loop (which it does) until the list hits length of 3 (which it does) then print the list (which it does) then hit the if statement and delete dan from the list and then print the new list (which it does not) do i need to nest the if statement or something else? thanks
.remove()and.pop()for lists: docs.python.org/2/tutorial/datastructures.html;required in Python.