Select Page

For my first day, I decided to have a refresher on while statements as I already have some what of a basic knowledge of Python, but I tend to stop using it for awhile and then the simple parts of code I tend to forget.

Anyway, today I created a while loop that adds names to a list and once the list reaches a certain count it will state that the list is now full. Basic I know, but I needed to refresh myself on them.

L = []

while len(L) < 3:
    new_name = input("Please add a new name: ")
    L.append(new_name)

print("Sorry the list is full")
print(L)