# Exercise 8-11 Archived Messages
# Learning Objective: Prevent the modification but act upon a list within a function

texts = ['message one', 'message two', 'message three']
sent_messages = []

def show_messages(messages):
    for message in messages:
        print(message)

def send_message(some_messages):
    while some_messages:
        to_be_sent = some_messages.pop()
        sent_messages.append(to_be_sent)
        print(f'{to_be_sent} has been sent')


#show_messages(texts)

send_message(texts[:])
print("SENT MESSAGES:\n")
print(sent_messages)
print('\nTEXTS:\n')
print(texts)