Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #КОпируем список, не трогая основной
- usernames = ['bernice', 'cody', 'aaron', 'ever', 'dalia']
- # Make a copy of the list.
- copied_usernames = usernames[:]
- print("The full copied list:\n\t", copied_usernames)
- # Remove the first two users from the copied list.
- del copied_usernames[0]
- del copied_usernames[0]
- print("\nTwo users removed from copied list:\n\t", copied_usernames)
- # The original list is unaffected.
- print("\nThe original list:\n\t", usernames)
Add Comment
Please, Sign In to add comment