From ff83419f2f68af6e5205f89abe4b1fad78228db2 Mon Sep 17 00:00:00 2001 From: Diem-Trang Pham <6422507+pdtrang@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:32:21 -0600 Subject: [PATCH] fix(curriculum): update examples in lecture-working-with-loops-and-sequences (#64379) --- .../6839e38cdf93ee5a00c79676.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/curriculum/challenges/english/blocks/lecture-working-with-loops-and-sequences/6839e38cdf93ee5a00c79676.md b/curriculum/challenges/english/blocks/lecture-working-with-loops-and-sequences/6839e38cdf93ee5a00c79676.md index 56c82dadb9d..7e3f5d153c2 100644 --- a/curriculum/challenges/english/blocks/lecture-working-with-loops-and-sequences/6839e38cdf93ee5a00c79676.md +++ b/curriculum/challenges/english/blocks/lecture-working-with-loops-and-sequences/6839e38cdf93ee5a00c79676.md @@ -56,22 +56,22 @@ print(numbers) # [1, 2, 2.5, 3, 4, 5] The following code will insert the number `2.5` at index `2` in the `numbers` list. -If you want to remove an element from a list, you can use the `remove()` method. Here is an example of using the `remove()` method to remove a duplicate number from a `numbers` list: +If you want to remove an element from a list, you can use the `remove()` method. The `remove()` method takes the value of the element to remove as an argument: ```py -numbers = [1, 2, 3, 4, 5, 5] -numbers.remove(5) +numbers = [10, 20, 30, 40, 50, 50] +numbers.remove(50) -print(numbers) # [1, 2, 3, 4, 5] +print(numbers) # [10, 20, 30, 40, 50] ``` It is important to note that this method will only remove the first occurrence of an item. Not all of them: ```py -numbers = [1, 2, 3, 4, 5, 5, 5] -numbers.remove(5) +numbers = [10, 20, 30, 40, 50, 50, 50] +numbers.remove(50) -print(numbers) # [1, 2, 3, 4, 5, 5] +print(numbers) # [10, 20, 30, 40, 50, 50] ``` To remove an element at a specific index in the list, you can use the `pop()` method like this: