From c10e8bb55107deea8904359f9083e1998df0b0c7 Mon Sep 17 00:00:00 2001 From: majestic-owl448 <26656284+majestic-owl448@users.noreply.github.com> Date: Thu, 22 Jan 2026 18:04:56 +0100 Subject: [PATCH] fix(curriculum): editable region in pin extractor workshop and typos (#65109) --- .../6852dd8486c7ee0171322950.md | 2 +- .../68530231c05b93324e071104.md | 4 +++- .../68531fbb934d735415053274.md | 5 +++-- .../68553423d775cc60134ac8bb.md | 5 +++-- .../685535bf527b2c77236b3a9a.md | 5 +++-- .../685578aae65e4106ad2b4300.md | 12 ++++++------ .../68557bd29f7f3c1880f98836.md | 6 +++--- .../6855918e87c33c6979d21d3f.md | 4 ++-- .../68559f3561d7df287586142e.md | 4 +++- .../685926db99041c5e619ead41.md | 4 ++-- .../68592730aaf34b61ae279168.md | 6 +++--- .../68592807861cfb658c90f70f.md | 8 ++++---- .../6859290fc8e07e6b2a8d8523.md | 7 ++++--- .../685929ee6d500c6f2bce6751.md | 2 +- .../68592b42b9c7f27cbe123203.md | 7 ++++--- .../68599f0fc7479410b2269742.md | 7 +++---- .../6859a037b3d6721c7fbb8055.md | 12 +++++++----- .../6859a082915dae1e0eaaf962.md | 3 ++- 18 files changed, 57 insertions(+), 46 deletions(-) diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/6852dd8486c7ee0171322950.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/6852dd8486c7ee0171322950.md index bb4aa65900d..345f113b5cc 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/6852dd8486c7ee0171322950.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/6852dd8486c7ee0171322950.md @@ -46,8 +46,8 @@ You should not have `pass` in your code anymore. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): +--fcc-editable-region-- pass --fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/68530231c05b93324e071104.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/68530231c05b93324e071104.md index 3c8e4a10f94..e38e48d05c2 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/68530231c05b93324e071104.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/68530231c05b93324e071104.md @@ -61,8 +61,10 @@ You should call the function `pin_extractor` with `poem` as argument. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' + +--fcc-editable-region-- + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/68531fbb934d735415053274.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/68531fbb934d735415053274.md index 9ed087c953d..ec3092eb563 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/68531fbb934d735415053274.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/68531fbb934d735415053274.md @@ -9,7 +9,7 @@ dashedName: step-4 Now that you have added a function call you can see any error created inside the function in the terminal, and you can always use `print` to see the value of things. -There is a digit of the pin hidden in any line, so inside the function use the `split` method to divide the string in a list of lines. Split the lines on the newline character (`\n`), and assign the resulting list to a variable called `lines`. +There is a digit of the pin hidden in every line, so inside the function use the `split` method to divide the string in a list of lines. Split the lines on the newline character (`\n`), and assign the resulting list to a variable called `lines`. # --hints-- @@ -38,11 +38,12 @@ The variable `lines` should have a value of `poem.split('\n')`. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' +--fcc-editable-region-- --fcc-editable-region-- + poem = """Stars and the moon shine in the sky white and bright diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/68553423d775cc60134ac8bb.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/68553423d775cc60134ac8bb.md index 57f3d65e667..58091bddae4 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/68553423d775cc60134ac8bb.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/68553423d775cc60134ac8bb.md @@ -56,10 +56,12 @@ You should have `print(line)` inside the loop. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') +--fcc-editable-region-- + +--fcc-editable-region-- poem = """Stars and the moon shine in the sky @@ -67,6 +69,5 @@ white and bright until the end of the night""" pin_extractor(poem) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/685535bf527b2c77236b3a9a.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/685535bf527b2c77236b3a9a.md index 39dab162ae2..b613b1df77e 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/685535bf527b2c77236b3a9a.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/685535bf527b2c77236b3a9a.md @@ -51,12 +51,14 @@ You should have `print(words)`. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') for line in lines: print(line) +--fcc-editable-region-- + +--fcc-editable-region-- poem = """Stars and the moon shine in the sky @@ -64,6 +66,5 @@ white and bright until the end of the night""" pin_extractor(poem) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/685578aae65e4106ad2b4300.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/685578aae65e4106ad2b4300.md index 0222a6ae489..f12dd757f14 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/685578aae65e4106ad2b4300.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/685578aae65e4106ad2b4300.md @@ -10,12 +10,12 @@ dashedName: step-7 As you learned in a previous lesson, the `enumerate` function allows to keep track of the index while looping over an iterable: ```py -fruits = ['apple', 'plum', 'bananas'] +fruits = ['apple', 'plum', 'bananas'] -for index, item in enumerate(fruits): - print(index, item) +for index, item in enumerate(fruits): + print(index, item) -# 0 apple +# 0 apple # 1 plum # 2 bananas ``` @@ -63,12 +63,13 @@ You should have `print(line_index, line)` inside the loop. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') +--fcc-editable-region-- for line in lines: print(line) +--fcc-editable-region-- words = line.split() print(words) @@ -78,6 +79,5 @@ white and bright until the end of the night""" pin_extractor(poem) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/68557bd29f7f3c1880f98836.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/68557bd29f7f3c1880f98836.md index 6b3b58b9c73..5b54fa65efc 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/68557bd29f7f3c1880f98836.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/68557bd29f7f3c1880f98836.md @@ -7,7 +7,7 @@ dashedName: step-8 # --description-- -In last line of the loop, update the `print` so that it prints the word inside the `words` list at index `line_index`. +In the last line of the loop, update the `print` call so that it prints the word inside the `words` list at index `line_index`. # --hints-- @@ -26,14 +26,15 @@ You should have `print(words[line_index])` at the end of the loop. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') for line_index, line in enumerate(lines): print(line_index, line) words = line.split() +--fcc-editable-region-- print(words) +--fcc-editable-region-- poem = """Stars and the moon @@ -42,6 +43,5 @@ white and bright until the end of the night""" pin_extractor(poem) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/6855918e87c33c6979d21d3f.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/6855918e87c33c6979d21d3f.md index fda1f9f4fb1..938cb56073f 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/6855918e87c33c6979d21d3f.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/6855918e87c33c6979d21d3f.md @@ -51,13 +51,14 @@ Inside the `if` statement you should have `secret_code += str(len(words[line_ind ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') for line_index, line in enumerate(lines): words = line.split() +--fcc-editable-region-- secret_code += str(len(words[line_index])) +--fcc-editable-region-- return secret_code poem = """Stars and the moon @@ -66,6 +67,5 @@ white and bright until the end of the night""" print(pin_extractor(poem)) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/68559f3561d7df287586142e.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/68559f3561d7df287586142e.md index 7713e923f01..e055e8af24e 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/68559f3561d7df287586142e.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/68559f3561d7df287586142e.md @@ -41,7 +41,6 @@ You should comment out the `print(pin_extractor(poem))` call. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') @@ -58,6 +57,9 @@ shine in the sky white and until the end of the night""" +--fcc-editable-region-- + + print(pin_extractor(poem)) --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/685926db99041c5e619ead41.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/685926db99041c5e619ead41.md index d9655e68734..ebd10310980 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/685926db99041c5e619ead41.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/685926db99041c5e619ead41.md @@ -26,14 +26,15 @@ You should have `print(len(words[line_index]))` at the end of the loop. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') for line_index, line in enumerate(lines): print(line_index, line) words = line.split() +--fcc-editable-region-- print(words[line_index]) +--fcc-editable-region-- poem = """Stars and the moon @@ -42,6 +43,5 @@ white and bright until the end of the night""" pin_extractor(poem) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/68592730aaf34b61ae279168.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/68592730aaf34b61ae279168.md index 43608e50884..beb71960bbe 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/68592730aaf34b61ae279168.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/68592730aaf34b61ae279168.md @@ -7,7 +7,7 @@ dashedName: step-10 # --description-- -The length returned from `len` is an integer, you need to convert it to a string using the `str` function. +The length returned from `len` is an integer, you need to convert it to a string using the `str` function to be able to add it to the `secret_code` string. Update the `print` call to print the length as a string. @@ -28,14 +28,15 @@ You should have `print(str(len(words[line_index])))` at the end of the loop. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') for line_index, line in enumerate(lines): print(line_index, line) words = line.split() +--fcc-editable-region-- print(len(words[line_index])) +--fcc-editable-region-- poem = """Stars and the moon @@ -44,6 +45,5 @@ white and bright until the end of the night""" pin_extractor(poem) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/68592807861cfb658c90f70f.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/68592807861cfb658c90f70f.md index df73c687d1d..455c00de940 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/68592807861cfb658c90f70f.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/68592807861cfb658c90f70f.md @@ -7,11 +7,11 @@ dashedName: step-11 # --description-- -Now you can concatenate `str(len(words[line_index]))` to `secret_code`. Remove the `print` call and use augmented assignment `+=` for concatenation. +Now you can concatenate `str(len(words[line_index]))` to `secret_code`. Remove the `print` call and use the augmented assignment `+=` for concatenation. # --hints-- -Inside the loop you should have `secret_code += str(len(words[line_index]))` +Inside the loop you should have `secret_code += str(len(words[line_index]))`. ```js ({ @@ -26,14 +26,15 @@ Inside the loop you should have `secret_code += str(len(words[line_index]))` ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') for line_index, line in enumerate(lines): print(line_index, line) words = line.split() +--fcc-editable-region-- print(str(len(words[line_index]))) +--fcc-editable-region-- poem = """Stars and the moon @@ -42,6 +43,5 @@ white and bright until the end of the night""" pin_extractor(poem) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/6859290fc8e07e6b2a8d8523.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/6859290fc8e07e6b2a8d8523.md index fe2ff8c6533..6c6fa0b3ac3 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/6859290fc8e07e6b2a8d8523.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/6859290fc8e07e6b2a8d8523.md @@ -7,7 +7,7 @@ dashedName: step-12 # --description-- -Remove the two `print` calls and add a `return` statement that returns `secret_code` as last line in the function. +Remove the two `print` calls and add a `return` statement that returns `secret_code` on the last line in the function. # --hints-- @@ -47,15 +47,17 @@ The `pin_extractor` function should return `secret_code` at the end. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') for line_index, line in enumerate(lines): +--fcc-editable-region-- print(line_index, line) words = line.split() print(str(len(words[line_index]))) secret_code += str(len(words[line_index])) + +--fcc-editable-region-- poem = """Stars and the moon @@ -64,6 +66,5 @@ white and bright until the end of the night""" pin_extractor(poem) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/685929ee6d500c6f2bce6751.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/685929ee6d500c6f2bce6751.md index 5603d0da02f..8d989e5bd7b 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/685929ee6d500c6f2bce6751.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/685929ee6d500c6f2bce6751.md @@ -32,7 +32,6 @@ def pin_extractor(poem): for line_index, line in enumerate(lines): words = line.split() secret_code += str(len(words[line_index])) - return secret_code @@ -40,6 +39,7 @@ poem = """Stars and the moon shine in the sky white and bright until the end of the night""" + --fcc-editable-region-- pin_extractor(poem) --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/68592b42b9c7f27cbe123203.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/68592b42b9c7f27cbe123203.md index c60405fb194..b104703661c 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/68592b42b9c7f27cbe123203.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/68592b42b9c7f27cbe123203.md @@ -45,7 +45,7 @@ The `else` clause should contain `secret_code += '0'`. }) ``` -`secret_code('There\nonce\nwas\na\ndragon')` should return `50000`. +`secret_code('There\nonce\nwas\na\ndragon')` should return `50000`. ```js ({ @@ -60,7 +60,6 @@ The `else` clause should contain `secret_code += '0'`. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poem): secret_code = '' lines = poem.split('\n') @@ -68,6 +67,9 @@ def pin_extractor(poem): words = line.split() if len(words) > line_index: secret_code += str(len(words[line_index])) +--fcc-editable-region-- + +--fcc-editable-region-- return secret_code poem = """Stars and the moon @@ -76,6 +78,5 @@ white and until the end of the night""" print(pin_extractor(poem)) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/68599f0fc7479410b2269742.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/68599f0fc7479410b2269742.md index bda6d8f4aa3..6ad613db6e3 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/68599f0fc7479410b2269742.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/68599f0fc7479410b2269742.md @@ -41,7 +41,7 @@ The loop should have `poem` as loop variable. }) ``` -You should move the existing body of the function into the new `for` loop. +You should move the existing body of the function into the new `for` loop. ```js ({ @@ -73,7 +73,7 @@ You should move the existing body of the function into the new `for` loop. ```py --fcc-editable-region-- def pin_extractor(poem): - + secret_code = '' lines = poem.split('\n') for line_index, line in enumerate(lines): @@ -83,7 +83,7 @@ def pin_extractor(poem): else: secret_code += '0' return secret_code - +--fcc-editable-region-- poem = """Stars and the moon shine in the sky white and @@ -93,6 +93,5 @@ poem2 = 'The grass is green\nhere and there\nhoping for rain\nbefore it turns ye poem3 = 'There\nonce\nwas\na\ndragon' # print(pin_extractor(poem)) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/6859a037b3d6721c7fbb8055.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/6859a037b3d6721c7fbb8055.md index 3a50f2f8970..7905e8cf9f2 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/6859a037b3d6721c7fbb8055.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/6859a037b3d6721c7fbb8055.md @@ -7,7 +7,9 @@ dashedName: step-18 # --description-- -Before the loop, create a new variable `secret_codes` that has a starting value of an empty list. Replace the `return secret_code` line with a line that appends `secret_code` to the `secret_codes` list. +Before the loop, create a new variable `secret_codes` that has a starting value of an empty list. + +Then replace the `return secret_code` line with a line that appends `secret_code` to the `secret_codes` list. # --hints-- @@ -58,9 +60,9 @@ You should not return `secret_code`. ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poems): - +--fcc-editable-region-- + for poem in poems: secret_code = '' lines = poem.split('\n') @@ -71,7 +73,8 @@ def pin_extractor(poems): else: secret_code += '0' return secret_code - +--fcc-editable-region-- + poem = """Stars and the moon shine in the sky white and @@ -81,6 +84,5 @@ poem2 = 'The grass is green\nhere and there\nhoping for rain\nbefore it turns ye poem3 = 'There\nonce\nwas\na\ndragon' # print(pin_extractor(poem)) ---fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-pin-extractor/6859a082915dae1e0eaaf962.md b/curriculum/challenges/english/blocks/workshop-pin-extractor/6859a082915dae1e0eaaf962.md index 7059f0e0c5c..419eef8cad4 100644 --- a/curriculum/challenges/english/blocks/workshop-pin-extractor/6859a082915dae1e0eaaf962.md +++ b/curriculum/challenges/english/blocks/workshop-pin-extractor/6859a082915dae1e0eaaf962.md @@ -70,7 +70,6 @@ assert pin_extractor([plum, apple, grape]) == ['2863', '3885', '9227'] ## --seed-contents-- ```py ---fcc-editable-region-- def pin_extractor(poems): secret_codes = [] for poem in poems: @@ -83,6 +82,8 @@ def pin_extractor(poems): else: secret_code += '0' secret_codes.append(secret_code) +--fcc-editable-region-- + poem = """Stars and the moon shine in the sky