We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collection of questions on list
Code-Snippets
## List copies a = 40 another_list = [6, 4, 1, 2, 5, a] list2 = list(another_list) #.copy() another_list.sort() print(another_list) print(list2) ## Nested list copies # create a list inner_list = [40, 50, 60] outer_list = [6, 4, 1, 2, 5, inner_list] copy_outer_list = list(outer_list) #.copy() # copy_outer_list = outer_list.copy() print(outer_list) print(copy_outer_list) inner_list[2] = 500 outer_list[1] = 100 print(outer_list) print(copy_outer_list)
The text was updated successfully, but these errors were encountered:
Maybe extend the modifying tricks section
numbers = [1, 2, 3, 4, 5] numbers[1] = ['a','b','c'] print(numbers) numbers = [1, 2, 3, 4, 5] numbers[1:2] = ['a','b','c'] print(numbers) numbers = [1, 2, 3, 4, 5] numbers[1:3] = ['a','b','c'] print(numbers) numbers = [1, 2, 3, 4, 5] numbers[1:4] = ['a','b','c'] print(numbers)
Sorry, something went wrong.
lists.ipynb
In the current order, list comprehensions are introduced before loops.
No branches or pull requests
Collection of questions on list
Code-Snippets
The text was updated successfully, but these errors were encountered: