mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-22 21:08:12 +08:00
fix(curriculum): remove double punctuation marks at the end of sentences (#65511)
This commit is contained in:
parent
7f27d8e005
commit
48e0f760a0
@ -217,7 +217,7 @@ assert "Valid ISBN Code." in out
|
||||
}})
|
||||
```
|
||||
|
||||
When the user enters `9781530051120,13`, you should see the message `Valid ISBN Code.`.
|
||||
When the user enters `9781530051120,13`, you should see the message `Valid ISBN Code.`
|
||||
|
||||
```js
|
||||
({test: () => {runPython(`
|
||||
@ -271,7 +271,7 @@ assert "Invalid ISBN Code." in out
|
||||
}})
|
||||
```
|
||||
|
||||
When the user enters `9781530051120,10`, you should see the message `ISBN-10 code should be 10 digits long.`.
|
||||
When the user enters `9781530051120,10`, you should see the message `ISBN-10 code should be 10 digits long.`
|
||||
|
||||
```js
|
||||
({test: () => {runPython(`
|
||||
@ -298,7 +298,7 @@ assert "ISBN-10 code should be 10 digits long." in out
|
||||
}})
|
||||
```
|
||||
|
||||
When the user enters `1530051126,13`, you should see the message `ISBN-13 code should be 13 digits long.`.
|
||||
When the user enters `1530051126,13`, you should see the message `ISBN-13 code should be 13 digits long.`
|
||||
|
||||
```js
|
||||
({test: () => {runPython(`
|
||||
@ -325,7 +325,7 @@ assert "ISBN-13 code should be 13 digits long." in out
|
||||
}})
|
||||
```
|
||||
|
||||
When the user enters `15-0051126,10`, you should see the message `Invalid character was found.`.
|
||||
When the user enters `15-0051126,10`, you should see the message `Invalid character was found.`
|
||||
|
||||
```js
|
||||
({test: () => {runPython(`
|
||||
@ -352,7 +352,7 @@ assert "Invalid character was found." in out
|
||||
}})
|
||||
```
|
||||
|
||||
When the user enters `1530051126,9`, you should see the message `Length should be 10 or 13.`.
|
||||
When the user enters `1530051126,9`, you should see the message `Length should be 10 or 13.`
|
||||
|
||||
```js
|
||||
({test: () => {runPython(`
|
||||
@ -379,7 +379,7 @@ assert "Length should be 10 or 13." in out
|
||||
}})
|
||||
```
|
||||
|
||||
When the user enters `1530051125,A`, you should see the message `Length must be a number.`.
|
||||
When the user enters `1530051125,A`, you should see the message `Length must be a number.`
|
||||
|
||||
```js
|
||||
({test: () => {runPython(`
|
||||
@ -406,7 +406,7 @@ assert "Length must be a number." in out
|
||||
}})
|
||||
```
|
||||
|
||||
When the user enters `1530051125`, you should see the message `Enter comma-separated values.`.
|
||||
When the user enters `1530051125`, you should see the message `Enter comma-separated values.`
|
||||
|
||||
```js
|
||||
({test: () => {runPython(`
|
||||
@ -433,7 +433,7 @@ assert "Enter comma-separated values." in out
|
||||
}})
|
||||
```
|
||||
|
||||
When the user enters `9971502100,10`, you should see the message `Valid ISBN Code.`.
|
||||
When the user enters `9971502100,10`, you should see the message `Valid ISBN Code.`
|
||||
|
||||
```js
|
||||
({test: () => {runPython(`
|
||||
@ -460,7 +460,7 @@ assert "Valid ISBN Code." in out
|
||||
}})
|
||||
```
|
||||
|
||||
When the user enters `080442957X,10`, you should see the message `Valid ISBN Code.`.
|
||||
When the user enters `080442957X,10`, you should see the message `Valid ISBN Code.`
|
||||
|
||||
```js
|
||||
({test: () => {runPython(`
|
||||
@ -487,7 +487,7 @@ assert "Valid ISBN Code." in out
|
||||
}})
|
||||
```
|
||||
|
||||
When the user enters `9781947172104,13`, you should see the message `Valid ISBN Code.`.
|
||||
When the user enters `9781947172104,13`, you should see the message `Valid ISBN Code.`
|
||||
|
||||
```js
|
||||
({test: () => {runPython(`
|
||||
|
||||
@ -55,19 +55,19 @@ The `year` variable shouldn't be empty.
|
||||
assert.isNotNull(year);
|
||||
```
|
||||
|
||||
With `2024` as the value of the `year` variable, the `result` should be `2024 is a leap year.`.
|
||||
With `2024` as the value of the `year` variable, the `result` should be `2024 is a leap year.`
|
||||
|
||||
```js
|
||||
assert.strictEqual(isLeapYear(2024), '2024 is a leap year.');
|
||||
```
|
||||
|
||||
With `2000` as the value of the `year` variable, the `result` should be `2000 is a leap year.`.
|
||||
With `2000` as the value of the `year` variable, the `result` should be `2000 is a leap year.`
|
||||
|
||||
```js
|
||||
assert.strictEqual(isLeapYear(2000), '2000 is a leap year.');
|
||||
```
|
||||
|
||||
With `1900` as the value of the `year` variable, the `result` should be `1900 is not a leap year.`.
|
||||
With `1900` as the value of the `year` variable, the `result` should be `1900 is not a leap year.`
|
||||
|
||||
```js
|
||||
assert.strictEqual(isLeapYear(1900), '1900 is not a leap year.');
|
||||
|
||||
@ -16,8 +16,8 @@ In this lab you will practice the basics of Python by building a small app that
|
||||
1. You should define a function named `number_pattern` that takes a single parameter `n` (representing a positive integer).
|
||||
1. `number_pattern` should use a `for` loop.
|
||||
1. `number_pattern(n)` should return a string with all the integers starting from 1 up to `n` (included) separated by a space. For example, `number_pattern(4)` should return the string `1 2 3 4`.
|
||||
1. If the argument passed to the function is not an integer value, the function should return `Argument must be an integer value.`.
|
||||
1. If the argument passed to the function is less than 1, the function should return `Argument must be an integer greater than 0.`.
|
||||
1. If the argument passed to the function is not an integer value, the function should return `Argument must be an integer value.`
|
||||
1. If the argument passed to the function is less than 1, the function should return `Argument must be an integer greater than 0.`
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@ -22,15 +22,15 @@ In this lab, you will build a voting system that uses `Map` to create a poll and
|
||||
|
||||
- If the `option` does not already exist in the poll, it should be added to the poll with an empty `Set` as its value to track voters. You should also return the message `Option "<option>" added to the poll.`
|
||||
|
||||
- If the `option` already exists, it should return the message `Option "<option>" already exists.`.
|
||||
- If the `option` already exists, it should return the message `Option "<option>" already exists.`
|
||||
|
||||
- If you try to add an empty option, the function should return the message `Option cannot be empty.`.
|
||||
- If you try to add an empty option, the function should return the message `Option cannot be empty.`
|
||||
|
||||
4. You should have a function `vote` that accepts two parameters, `option` (the option to vote for) and `voterId` (a unique ID for the voter).
|
||||
|
||||
5. In the `vote` function:
|
||||
|
||||
- If the `option` does not exist in the poll, the function should return the message `Option "<option>" does not exist.`.
|
||||
- If the `option` does not exist in the poll, the function should return the message `Option "<option>" does not exist.`
|
||||
|
||||
- If the `option` exists, the function should check if the `voterId` has already voted for this `option`.
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ This task doesn't have audio. Read the question and select the correct answer.
|
||||
|
||||
## --text--
|
||||
|
||||
What does `it` refer to in the sentence `The Live Preview isn't showing in Visual Studio Code. Isn't it supposed to support that feature?`?
|
||||
What does `it` refer to in the sentence `The Live Preview isn't showing in Visual Studio Code. Isn't it supposed to support that feature?`
|
||||
|
||||
## --answers--
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ Check if the response uses the correct tense for a future event. Maria is asking
|
||||
|
||||
# --explanation--
|
||||
|
||||
Maria's question uses the `Present Simple` tense, `The server downtime starts...`, to talk about a planned event.
|
||||
Maria's question uses the `Present Simple` tense, `The server downtime starts...`, to talk about a planned event.
|
||||
|
||||
This is common when discussing schedules or timetables, as the `Present Simple` indicates something fixed or organized in the future. Her intention is to confirm the timing of the downtime as planned.
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ This task doesn't have audio. Read the question below and select the correct ans
|
||||
|
||||
## --text--
|
||||
|
||||
Which of the following best completes the phrase `Really? That sounds great! ...`?
|
||||
Which of the following best completes the phrase `Really? That sounds great!`?
|
||||
|
||||
## --answers--
|
||||
|
||||
|
||||
@ -62,4 +62,4 @@ The text focuses on fixing security issues, not documentation.
|
||||
|
||||
# --explanation--
|
||||
|
||||
Focus on the paragraph that starts with `Last week, our team had to…`. This explains why the team worked late.
|
||||
Focus on the paragraph that starts with `Last week, our team had to...`. This explains why the team worked late.
|
||||
|
||||
@ -62,4 +62,4 @@ The text teaches the opposite: to stay on top of things and not fall behind.
|
||||
|
||||
# --explanation--
|
||||
|
||||
Focus on the sentence that starts with `We now know that we need to…`. This teaches the main lesson: integrating security checks during design updates.
|
||||
Focus on the sentence that starts with `We now know that we need to...`. This teaches the main lesson: integrating security checks during design updates.
|
||||
|
||||
@ -62,4 +62,4 @@ There is no mention of a consultant handling security in the text.
|
||||
|
||||
# --explanation--
|
||||
|
||||
Focus on the sentence that starts with `Jake, who handles…`. This identifies him as the person responsible for security.
|
||||
Focus on the sentence that starts with `Jake, who handles...`. This identifies him as the person responsible for security.
|
||||
|
||||
@ -62,4 +62,4 @@ They learned to stay on top of things and not fall behind.
|
||||
|
||||
# --explanation--
|
||||
|
||||
Focus on the sentence that starts with `This experience taught us…`. This highlights the overall takeaway about staying on top of tasks.
|
||||
Focus on the sentence that starts with `This experience taught us...`. This highlights the overall takeaway about staying on top of tasks.
|
||||
|
||||
@ -60,4 +60,4 @@ The dream mentioned is related to attending a tech conference, not starting a bu
|
||||
|
||||
# --explanation--
|
||||
|
||||
Focus on the sentence that starts with `Years ago, Maria and Brian…`. This sentence explains Maria and Brian's goal when they were junior developers, sitting in their office and dreaming about the future.
|
||||
Focus on the sentence that starts with `Years ago, Maria and Brian...`. This sentence explains Maria and Brian's goal when they were junior developers, sitting in their office and dreaming about the future.
|
||||
|
||||
@ -60,4 +60,4 @@ They were excited about every new programming trend.
|
||||
|
||||
# --explanation--
|
||||
|
||||
Focus on the sentence that starts with `Back then, they were junior developers…`. This sentence provides insight into how Maria and Brian felt about new programming trends early in their careers.
|
||||
Focus on the sentence that starts with `Back then, they were junior developers...`. This sentence provides insight into how Maria and Brian felt about new programming trends early in their careers.
|
||||
|
||||
@ -60,4 +60,4 @@ The focus of the sessions mentioned in the text is more technical and specific.
|
||||
|
||||
# --explanation--
|
||||
|
||||
Focus on the sentence that starts with `Fast forward to today…`. This sentence lists the sessions that Maria and Brian are attending at PyCon, reflecting their current interests.
|
||||
Focus on the sentence that starts with `Fast forward to today...`. This sentence lists the sessions that Maria and Brian are attending at PyCon, reflecting their current interests.
|
||||
|
||||
@ -60,4 +60,4 @@ The text indicates they are already attending, not planning for a future event.
|
||||
|
||||
# --explanation
|
||||
|
||||
Focus on the sentence that starts with `Their dream is no longer just a dream…`. This sentence tells us that Maria and Brian are now living the dream they once envisioned.
|
||||
Focus on the sentence that starts with `Their dream is no longer just a dream...`. This sentence tells us that Maria and Brian are now living the dream they once envisioned.
|
||||
|
||||
@ -60,4 +60,4 @@ There is no mention of a product launch; the significance lies in achieving thei
|
||||
|
||||
# --explanation--
|
||||
|
||||
Focus on the sentence that starts with `They promised they would…`. This sentence shows that attending PyCon was their goal, making it significant as it fulfills a long-held promise.
|
||||
Focus on the sentence that starts with `They promised they would...`. This sentence shows that attending PyCon was their goal, making it significant as it fulfills a long-held promise.
|
||||
|
||||
@ -54,12 +54,12 @@ Remember:
|
||||
|
||||
`Must` expresses strong necessity or obligation. For example:
|
||||
|
||||
`You must wear a seatbelt.`.
|
||||
`You must wear a seatbelt.`
|
||||
|
||||
`Have to` also expresses obligation but is sometimes less strict than must. For example:
|
||||
|
||||
`You have to submit the report by Friday.`.
|
||||
`You have to submit the report by Friday.`
|
||||
|
||||
`Should` is used for recommendations or advice. For example:
|
||||
|
||||
`You should review your notes before the test.`.
|
||||
`You should review your notes before the test.`
|
||||
|
||||
@ -14,7 +14,7 @@ This task doesn't have audio. Read the question below and select the correct ans
|
||||
|
||||
## --text--
|
||||
|
||||
Which sentence uses the word `in` the same way as in this sentence: `The server room is located in the building's basement.`?
|
||||
Which sentence uses the word `in` the same way as in this sentence: `The server room is located in the building's basement`?
|
||||
|
||||
## --answers--
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ The sequence terminates when some $a_n = 1$.
|
||||
|
||||
Given any integer, we can list out the sequence of steps. For instance if $a_1 = 231$, then the sequence $\\{a_n\\} = \\{231, 77, 51, 17, 11, 7, 10, 14, 9, 3, 1\\}$ corresponds to the steps "DdDddUUdDD".
|
||||
|
||||
Of course, there are other sequences that begin with that same sequence "DdDddUUdDD....".
|
||||
Of course, there are other sequences that begin with that same sequence "DdDddUUdDD...".
|
||||
|
||||
For instance, if $a_1 = 1004064$, then the sequence is DdDddUUdDDDdUDUUUdDdUUDDDUdDD.
|
||||
|
||||
|
||||
@ -82,19 +82,19 @@ Using Markov Algorithm, change the `data` into the desired `outputs` using the
|
||||
assert(typeof markov === 'function');
|
||||
```
|
||||
|
||||
`markov(["A -> apple","B -> bag","S -> shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.")` should return the string `I bought a bag of apples from my brother.`.
|
||||
`markov(["A -> apple","B -> bag","S -> shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.")` should return the string `I bought a bag of apples from my brother.`
|
||||
|
||||
```js
|
||||
assert.deepEqual(markov(rules[0], datas[0]), outputs[0]);
|
||||
```
|
||||
|
||||
`markov(["A -> apple","B -> bag","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.")` should return the string `I bought a bag of apples from T shop.`.
|
||||
`markov(["A -> apple","B -> bag","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.")` should return the string `I bought a bag of apples from T shop.`
|
||||
|
||||
```js
|
||||
assert.deepEqual(markov(rules[1], datas[1]), outputs[1]);
|
||||
```
|
||||
|
||||
`markov(["A -> apple","WWWW -> with","Bgage -> ->.*","B -> bag","->.* -> money","W -> WW","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As W my Bgage from T S.")` should return the string `I bought a bag of apples with my money from T shop.`.
|
||||
`markov(["A -> apple","WWWW -> with","Bgage -> ->.*","B -> bag","->.* -> money","W -> WW","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As W my Bgage from T S.")` should return the string `I bought a bag of apples with my money from T shop.`
|
||||
|
||||
```js
|
||||
assert.deepEqual(markov(rules[2], datas[2]), outputs[2]);
|
||||
|
||||
@ -21,7 +21,7 @@ const tableRow = tableBody?.querySelectorAll('tr')?.[0];
|
||||
assert.isNotNull(tableRow?.querySelector('th'));
|
||||
```
|
||||
|
||||
Your `th` element should have the text `Cash This is the cash we currently have on hand.`.
|
||||
Your `th` element should have the text `Cash This is the cash we currently have on hand.`
|
||||
|
||||
```js
|
||||
const tableBody = document.querySelector('tbody');
|
||||
|
||||
@ -21,7 +21,7 @@ const tableRow = tableBody?.querySelectorAll('tr')?.[1];
|
||||
assert.isNotNull(tableRow?.querySelector('th'));
|
||||
```
|
||||
|
||||
Your `th` element should have the text `Checking Our primary transactional account.`.
|
||||
Your `th` element should have the text `Checking Our primary transactional account.`
|
||||
|
||||
```js
|
||||
const tableBody = document.querySelector('tbody');
|
||||
|
||||
@ -21,7 +21,7 @@ const tableRow = tableBody?.querySelectorAll('tr')?.[2];
|
||||
assert.isNotNull(tableRow?.querySelector('th'));
|
||||
```
|
||||
|
||||
Your `th` element should have the text `Savings Funds set aside for emergencies.`.
|
||||
Your `th` element should have the text `Savings Funds set aside for emergencies.`
|
||||
|
||||
```js
|
||||
const tableBody = document.querySelector('tbody');
|
||||
|
||||
@ -22,7 +22,7 @@ const tableRow = tbody?.querySelectorAll('tr')?.[0];
|
||||
assert.isNotNull(tableRow?.querySelector('th'));
|
||||
```
|
||||
|
||||
Your `th` element should have the text `Loans The outstanding balance on our startup loan.`.
|
||||
Your `th` element should have the text `Loans The outstanding balance on our startup loan.`
|
||||
|
||||
```js
|
||||
const table = document.querySelectorAll('table')?.[1];
|
||||
|
||||
@ -22,7 +22,7 @@ const tableRow = tbody?.querySelectorAll('tr')?.[1];
|
||||
assert.isNotNull(tableRow?.querySelector('th'));
|
||||
```
|
||||
|
||||
Your `th` element should have the text `Expenses Annual anticipated expenses, such as payroll.`.
|
||||
Your `th` element should have the text `Expenses Annual anticipated expenses, such as payroll.`
|
||||
|
||||
```js
|
||||
const table = document.querySelectorAll('table')?.[1];
|
||||
|
||||
@ -7,13 +7,13 @@ dashedName: step-8
|
||||
|
||||
# --description--
|
||||
|
||||
Below your `h2` element, add a paragraph element with the text of `Hi there! I'm Jane Doe, a passionate writer who finds endless inspiration in the antics of my beloved cat, Mr. Whiskers.`.
|
||||
Below your `h2` element, add a paragraph element with the text of `Hi there! I'm Jane Doe, a passionate writer who finds endless inspiration in the antics of my beloved cat, Mr. Whiskers.`
|
||||
|
||||
Below your paragraph element, add another paragraph element with the text of `His playful nature and boundless energy keeps me on my toes. I love him so much.`
|
||||
|
||||
# --hints--
|
||||
|
||||
Your first paragraph should have the text of `Hi there! I'm Jane Doe, a passionate writer who finds endless inspiration in the antics of my beloved cat, Mr. Whiskers.` Double check your spelling.
|
||||
Your first paragraph should have the text of `Hi there! I'm Jane Doe, a passionate writer who finds endless inspiration in the antics of my beloved cat, Mr. Whiskers.` Double-check your spelling.
|
||||
|
||||
```js
|
||||
const pElement = document.querySelector('body p:first-of-type');
|
||||
|
||||
@ -21,7 +21,7 @@ You should have a `p` element nested inside the element having a class of `card`
|
||||
assert.exists(document.querySelector('.card p'));
|
||||
```
|
||||
|
||||
Your `p` element's text should be `This is an epic story of Sally and her dog Rex as they navigate through other worlds.`.
|
||||
Your `p` element's text should be `This is an epic story of Sally and her dog Rex as they navigate through other worlds.`
|
||||
|
||||
```js
|
||||
assert.equal(document.querySelector('.card p')?.innerText.trim(), "This is an epic story of Sally and her dog Rex as they navigate through other worlds.");
|
||||
|
||||
@ -22,7 +22,7 @@ const cards = document.querySelectorAll('.card');
|
||||
assert.exists(cards[1]?.querySelector('p'));
|
||||
```
|
||||
|
||||
Your second card's `p` element's text should be `This is the story of Dave as he learns to cook everything from pancakes to pasta, one recipe at a time.`.
|
||||
Your second card's `p` element's text should be `This is the story of Dave as he learns to cook everything from pancakes to pasta, one recipe at a time.`
|
||||
|
||||
```js
|
||||
const cards = document.querySelectorAll('.card');
|
||||
|
||||
@ -31,7 +31,7 @@ The newly added `p` element should be below the element with a class of `card-co
|
||||
assert.exists(document.querySelector('.card-container + p'));
|
||||
```
|
||||
|
||||
Your new `p` element's text should be `Review your selections and continue to checkout.`.
|
||||
Your new `p` element's text should be `Review your selections and continue to checkout.`
|
||||
|
||||
```js
|
||||
const cardContainer = document.querySelector('.card-container');
|
||||
|
||||
@ -14,7 +14,7 @@ if condition:
|
||||
# code to run when condition is true
|
||||
```
|
||||
|
||||
At the beginning of your function body, create an `if` statement. For now, use `True` as the condition, and within the `if` statement body return the string `Shift must be an integer value.`.
|
||||
At the beginning of your function body, create an `if` statement. For now, use `True` as the condition, and within the `if` statement body return the string `Shift must be an integer value.`
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ dashedName: step-19
|
||||
|
||||
# --description--
|
||||
|
||||
A negative or null shift should not be accepted by your function. Therefore, after your first `if` statement, create another `if` statement that checks if `shift` is less than `1` and returns the string `Shift must be a positive integer.`.
|
||||
A negative or null shift should not be accepted by your function. Therefore, after your first `if` statement, create another `if` statement that checks if `shift` is less than `1` and returns the string `Shift must be a positive integer.`
|
||||
|
||||
# --hints--
|
||||
|
||||
@ -21,7 +21,7 @@ assert any(_cond.is_equivalent(option) for option in _options)
|
||||
`) })
|
||||
```
|
||||
|
||||
Your second `if` statement should return `Shift must be a positive integer.`.
|
||||
Your second `if` statement should return `Shift must be a positive integer.`
|
||||
|
||||
```js
|
||||
({ test: () => assert(runPython(`_Node(_code).find_function("caesar").find_ifs()[1].find_bodies()[0].has_return("'Shift must be a positive integer.'")`)) })
|
||||
|
||||
@ -11,7 +11,7 @@ As you've already verified, the shift passed to encrypt the text should be posit
|
||||
|
||||
Add a second condition to the `if` statement that verifies that `shift` is greater than `25`. Remember that the logical OR operation in Python is implemented through the `or` operator.
|
||||
|
||||
Also, update the returned message to `Shift must be an integer between 1 and 25.`.
|
||||
Also, update the returned message to `Shift must be an integer between 1 and 25.`
|
||||
|
||||
# --hints--
|
||||
|
||||
@ -25,7 +25,7 @@ assert any(_cond.is_equivalent(f"shift < 1 or {option}") for option in _options)
|
||||
`) })
|
||||
```
|
||||
|
||||
Your second `if` statement should return `Shift must be an integer between 1 and 25.`.
|
||||
Your second `if` statement should return `Shift must be an integer between 1 and 25.`
|
||||
|
||||
```js
|
||||
({ test: () => assert(runPython(`_Node(_code).find_function("caesar").find_ifs()[1].find_bodies()[0].has_return("'Shift must be an integer between 1 and 25.'")`)) })
|
||||
|
||||
@ -7,7 +7,7 @@ dashedName: step-25
|
||||
|
||||
# --description--
|
||||
|
||||
Now you're going to test the `decrypt` function. Replace the value assigned to `encrypted_text` with the following string, which represents a message to decrypt: `Pbhentr vf sbhaq va hayvxryl cynprf.`.
|
||||
Now you're going to test the `decrypt` function. Replace the value assigned to `encrypted_text` with the following string, which represents a message to decrypt: `Pbhentr vf sbhaq va hayvxryl cynprf.`
|
||||
|
||||
Then, declare a variable named `decrypted_text` and assign it a call to `decrypt` with `encrypted_text` as it first argument and a shift of `13` as the second argument.
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ Add `p` tags to turn `See more <a href="https://freecatphotoapp.com">cat photos<
|
||||
|
||||
# --hints--
|
||||
|
||||
You should add a `p` element around `See more <a href="https://freecatphotoapp.com">cat photos</a> in our gallery.`.
|
||||
You should add a `p` element around `See more <a href="https://freecatphotoapp.com">cat photos</a> in our gallery.`
|
||||
|
||||
```js
|
||||
const P = document.querySelectorAll('p')[1];
|
||||
|
||||
@ -12,7 +12,7 @@ Now you'll simulate sending some emails between the users.
|
||||
In your `main` function, after creating the users, use the `send_email` method to:
|
||||
|
||||
- Have Tory send an email to the `ramy` user object with subject `Hello` and body `Hi Ramy, just saying hello!`.
|
||||
- Have Ramy send an email to the `tory` user object with subject `Re: Hello` and body `Hi Tory, hope you are fine.`.
|
||||
- Have Ramy send an email to the `tory` user object with subject `Re: Hello` and body `Hi Tory, hope you are fine.`
|
||||
|
||||
# --hints--
|
||||
|
||||
@ -28,7 +28,7 @@ You should have Tory send an email to `ramy`, subject `Hello`, and body `Hi Ramy
|
||||
})
|
||||
```
|
||||
|
||||
You should have Ramy send an email to `tory`, subject `Re: Hello`, and body `Hi Tory, hope you are fine.`.
|
||||
You should have Ramy send an email to `tory`, subject `Re: Hello`, and body `Hi Tory, hope you are fine.`
|
||||
|
||||
```js
|
||||
({
|
||||
|
||||
@ -9,7 +9,7 @@ dashedName: step-2
|
||||
|
||||
Below the `h1` element, add a `p` element with class `description`.
|
||||
|
||||
Inside the `p` element write the text `Click on the buttons below to rate your emotions.`.
|
||||
Inside the `p` element write the text `Click on the buttons below to rate your emotions.`
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ Your `strong` element should have the text `Error!`.
|
||||
assert.equal(document.querySelector("strong")?.textContent, "Error!");
|
||||
```
|
||||
|
||||
Your `p` element should have the correct text that ends with `Something went wrong. Please try again.`.
|
||||
Your `p` element should have the correct text that ends with `Something went wrong. Please try again.`
|
||||
|
||||
```js
|
||||
const remainingText = "Something went wrong. Please try again."
|
||||
|
||||
@ -42,7 +42,7 @@ const ddElement = document.querySelector('dl dd');
|
||||
assert.exists(ddElement);
|
||||
```
|
||||
|
||||
Your `dd` element should contain the text `This is a free web browser developed by Google and first released in 2008.`.
|
||||
Your `dd` element should contain the text `This is a free web browser developed by Google and first released in 2008.`
|
||||
|
||||
```js
|
||||
const ddElement = document.querySelector('dd');
|
||||
|
||||
@ -40,7 +40,7 @@ const ddElements = document.querySelectorAll('dd');
|
||||
assert.lengthOf(ddElements, 2);
|
||||
```
|
||||
|
||||
Your second `dd` element should contain the text `This is a free web browser developed by the Mozilla Corporation and first created in 2004.`.
|
||||
Your second `dd` element should contain the text `This is a free web browser developed by the Mozilla Corporation and first created in 2004.`
|
||||
|
||||
```js
|
||||
const ddElement = document.querySelectorAll('dd')[1];
|
||||
|
||||
@ -40,7 +40,7 @@ const ddElements = document.querySelectorAll('dd');
|
||||
assert.lengthOf(ddElements, 3);
|
||||
```
|
||||
|
||||
Your third `dd` element should contain the text `This browser was developed by Apple and is the default browser for iPhone, iPad and Mac devices.`.
|
||||
Your third `dd` element should contain the text `This browser was developed by Apple and is the default browser for iPhone, iPad and Mac devices.`
|
||||
|
||||
```js
|
||||
const ddElement = document.querySelectorAll('dd')[2];
|
||||
|
||||
@ -40,7 +40,7 @@ const ddElements = document.querySelectorAll('dd');
|
||||
assert.lengthOf(ddElements, 4);
|
||||
```
|
||||
|
||||
Your fourth `dd` element should contain the text `This is a free web browser first released in 2016 that is based on the Chromium web browser.`.
|
||||
Your fourth `dd` element should contain the text `This is a free web browser first released in 2016 that is based on the Chromium web browser.`
|
||||
|
||||
```js
|
||||
const ddElement = document.querySelectorAll('dd')[3];
|
||||
|
||||
@ -15,7 +15,7 @@ def add(x, y):
|
||||
return x + y
|
||||
```
|
||||
|
||||
Complete your `Movie` class by adding the following docstring to it: `Parent class representing a movie.`.
|
||||
Complete your `Movie` class by adding the following docstring to it: `Parent class representing a movie.`
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ dashedName: step-26
|
||||
|
||||
# --description--
|
||||
|
||||
Now complete the `TVSeries` class by adding the docstring `Child class representing an entire TV series.`.
|
||||
Now complete the `TVSeries` class by adding the docstring `Child class representing an entire TV series.`
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ dashedName: step-10
|
||||
|
||||
Next, add another method to your class named `get_fact` that returns a fact about the instrument.
|
||||
|
||||
This method should have only the `self` parameter and return an f-string that says `The [instrument name] is part of the [instrument type] family of instruments.`.
|
||||
This method should have only the `self` parameter and return an f-string that says `The [instrument name] is part of the [instrument type] family of instruments.`
|
||||
|
||||
Unlike the `play` method which prints a message directly, this method should return a string that can be used elsewhere in your code.
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ You should have a `p` element.
|
||||
assert.exists(document.querySelector("p"));
|
||||
```
|
||||
|
||||
Your `p` element should have the text `Please fill out the form below to help schedule your parent-teacher conference.`.
|
||||
Your `p` element should have the text `Please fill out the form below to help schedule your parent-teacher conference.`
|
||||
|
||||
```js
|
||||
assert.strictEqual(document.querySelector("p")?.innerText, "Please fill out the form below to help schedule your parent-teacher conference.");
|
||||
|
||||
@ -42,7 +42,7 @@ Your `sellPlants` function should take three arguments.
|
||||
assert.lengthOf(sellPlants, 3);
|
||||
```
|
||||
|
||||
`sellPlants(ballerina, "small", 25)` should return `Not enough small size pots for Lavandula stoechas 'Ballerina'. Only 20 left.`.
|
||||
`sellPlants(ballerina, "small", 25)` should return `Not enough small size pots for Lavandula stoechas 'Ballerina'. Only 20 left.`
|
||||
|
||||
```js
|
||||
assert.equal(sellPlants(ballerina, "small", 25), "Not enough small size pots for Lavandula stoechas 'Ballerina'. Only 20 left.")
|
||||
|
||||
@ -7,7 +7,7 @@ dashedName: step-14
|
||||
|
||||
# --description--
|
||||
|
||||
When there are enough pots to sell you need to update the catalog by subtracting the pots of the specified size. In that case, return `Catalog successfully updated.`.
|
||||
When there are enough pots to sell you need to update the catalog by subtracting the pots of the specified size. In that case, return `Catalog successfully updated.`
|
||||
|
||||
Modify your function to achieve that. Then, update your function call by passing `10` as third argument instead of `25`.
|
||||
|
||||
@ -25,7 +25,7 @@ You should have only one `sellPlants` call in your code.
|
||||
assert.lengthOf(__helpers.removeJSComments(code).match(/(?<!function\s+)sellPlants\s*\(/g), 1)
|
||||
```
|
||||
|
||||
`sellPlants(ballerina, "small", 25)` should return `Not enough small size pots for Lavandula stoechas 'Ballerina'. Only 10 left.`.
|
||||
`sellPlants(ballerina, "small", 25)` should return `Not enough small size pots for Lavandula stoechas 'Ballerina'. Only 10 left.`
|
||||
|
||||
```js
|
||||
assert.equal(sellPlants(ballerina, "small", 25), "Not enough small size pots for Lavandula stoechas 'Ballerina'. Only 10 left.")
|
||||
|
||||
@ -40,13 +40,13 @@ testCatalog.set(royalCrown, { small: 40, medium: 22, large: 9 });
|
||||
assert.deepEqual(catalog, testCatalog);
|
||||
```
|
||||
|
||||
`sellPlants(ballerina, "small", 10)` should return `Item not found.`.
|
||||
`sellPlants(ballerina, "small", 10)` should return `Item not found.`
|
||||
|
||||
```js
|
||||
assert.equal(sellPlants(ballerina, "small", 10), "Item not found.")
|
||||
```
|
||||
|
||||
`sellPlants(hidcote, "large", 95)` should return `Not enough large size pots for Lavandula angustifolia 'Hidcote'. Only 18 left.`.
|
||||
`sellPlants(hidcote, "large", 95)` should return `Not enough large size pots for Lavandula angustifolia 'Hidcote'. Only 18 left.`
|
||||
|
||||
```js
|
||||
assert.equal(sellPlants(hidcote, "large", 95), "Not enough large size pots for Lavandula angustifolia 'Hidcote'. Only 18 left.")
|
||||
|
||||
@ -7,7 +7,7 @@ dashedName: step-2
|
||||
|
||||
# --description--
|
||||
|
||||
Now, create a paragraph element below the `h1` element. Inside this paragraph add the text `Learning to code is hard, but as Quincy Larson says, You can become a developer.`.
|
||||
Now, create a paragraph element below the `h1` element. Inside this paragraph add the text `Learning to code is hard, but as Quincy Larson says, You can become a developer.`
|
||||
|
||||
# --hints--
|
||||
|
||||
@ -17,7 +17,7 @@ You should have a `p` element.
|
||||
assert.exists(document.querySelector('p'));
|
||||
```
|
||||
|
||||
Your paragraph should have the text `Learning to code is hard, but as Quincy Larson says, You can become a developer.`. Double check your spelling.
|
||||
Your paragraph should have the text `Learning to code is hard, but as Quincy Larson says, You can become a developer.`. Double-check your spelling.
|
||||
|
||||
```js
|
||||
assert.equal(document.querySelector('p')?.textContent.trim(), "Learning to code is hard, but as Quincy Larson says, You can become a developer.");
|
||||
|
||||
@ -35,7 +35,7 @@ Your `q` element should be nested inside the paragraph that is below the `h1` el
|
||||
assert.exists(document.querySelector('h1 + p > q'));
|
||||
```
|
||||
|
||||
Your `q` element should have the text `You can become a developer.`.
|
||||
Your `q` element should have the text `You can become a developer.`
|
||||
|
||||
```js
|
||||
assert.equal(document.querySelector('h1 + p > q')?.textContent.trim(), 'You can become a developer.');
|
||||
|
||||
@ -34,28 +34,28 @@ const pElements = document.querySelectorAll('main > section:nth-of-type(2) > blo
|
||||
assert.lengthOf(pElements, 4);
|
||||
```
|
||||
|
||||
Your first `p` element should have the text `So much of getting a job is who you know.`.
|
||||
Your first `p` element should have the text `So much of getting a job is who you know.`
|
||||
|
||||
```js
|
||||
const firstPEl = document.querySelector('main > section:nth-of-type(2) > blockquote > p:nth-of-type(1)');
|
||||
assert.equal(firstPEl?.innerText.trim(), 'So much of getting a job is who you know.');
|
||||
```
|
||||
|
||||
Your second `p` element should have the text `It's OK to be an introvert, but you do need to push your boundaries.`.
|
||||
Your second `p` element should have the text `It's OK to be an introvert, but you do need to push your boundaries.`
|
||||
|
||||
```js
|
||||
const secondPEl = document.querySelector('main > section:nth-of-type(2) > blockquote > p:nth-of-type(2)');
|
||||
assert.equal(secondPEl?.innerText.trim(), "It's OK to be an introvert, but you do need to push your boundaries.");
|
||||
```
|
||||
|
||||
Your third `p` element should have the text `Create GitHub, Twitter, LinkedIn, and Discord accounts.`.
|
||||
Your third `p` element should have the text `Create GitHub, Twitter, LinkedIn, and Discord accounts.`
|
||||
|
||||
```js
|
||||
const thirdPEl = document.querySelector('main > section:nth-of-type(2) > blockquote > p:nth-of-type(3)');
|
||||
assert.equal(thirdPEl?.innerText.trim(), 'Create GitHub, Twitter, LinkedIn, and Discord accounts.');
|
||||
```
|
||||
|
||||
Your forth `p` element should have the text `Go to tech meetups and conferences. Travel if you have to.`.
|
||||
Your forth `p` element should have the text `Go to tech meetups and conferences. Travel if you have to.`
|
||||
|
||||
```js
|
||||
const forthPEl = document.querySelector('main > section:nth-of-type(2) > blockquote > p:nth-of-type(4)');
|
||||
|
||||
@ -69,21 +69,21 @@ const pElements = document.querySelectorAll('main > section:nth-of-type(3) > blo
|
||||
assert.lengthOf(pElements, 3);
|
||||
```
|
||||
|
||||
Your first `p` element should have the text `Share short video demos of your projects.`.
|
||||
Your first `p` element should have the text `Share short video demos of your projects.`
|
||||
|
||||
```js
|
||||
const firstPEl = document.querySelector('main > section:nth-of-type(3) > blockquote > p:nth-of-type(1)');
|
||||
assert.equal(firstPEl?.innerText.trim(), 'Share short video demos of your projects.');
|
||||
```
|
||||
|
||||
Your second `p` element should have the text `Keep applying to speak at bigger and bigger conferences.`.
|
||||
Your second `p` element should have the text `Keep applying to speak at bigger and bigger conferences.`
|
||||
|
||||
```js
|
||||
const secondPEl = document.querySelector('main > section:nth-of-type(3) > blockquote > p:nth-of-type(2)');
|
||||
assert.equal(secondPEl?.innerText.trim(), "Keep applying to speak at bigger and bigger conferences.");
|
||||
```
|
||||
|
||||
Your third `p` element should have the text `Hang out at hackerspaces and help people who are even newer to coding than you.`.
|
||||
Your third `p` element should have the text `Hang out at hackerspaces and help people who are even newer to coding than you.`
|
||||
|
||||
```js
|
||||
const thirdPEl = document.querySelector('main > section:nth-of-type(3) > blockquote > p:nth-of-type(3)');
|
||||
|
||||
@ -9,7 +9,7 @@ dashedName: step-14
|
||||
|
||||
Now it's time to add some validation to the `__init__` method. At the beginning of the method, create an `if` statement that checks if either `name` or `level` are not instances of `str`.
|
||||
|
||||
Inside the `if` statement, raise a `TypeError` with the message `'name' and 'level' attribute must be of type 'str'.`.
|
||||
Inside the `if` statement, raise a `TypeError` with the message `'name' and 'level' attribute must be of type 'str'.`
|
||||
|
||||
# --hints--
|
||||
|
||||
@ -34,7 +34,7 @@ Your `if` statement should check if either `name` and `level` are not instances
|
||||
`) })
|
||||
```
|
||||
|
||||
Your `if` statement should raise a `TypeError` with the message `'name' and 'level' attribute must be of type 'str'.`.
|
||||
Your `if` statement should raise a `TypeError` with the message `'name' and 'level' attribute must be of type 'str'.`
|
||||
|
||||
```js
|
||||
({ test: () => assert(runPython(`_Node(_code).find_class("Employee").find_function("__init__").find_ifs()[0].find_bodies()[0].has_stmt('raise TypeError("\\'name\\' and \\'level\\' attribute must be of type \\'str\\'.")')`)) })
|
||||
|
||||
@ -17,7 +17,7 @@ You should have a third `if` statement inside your `level` setter.
|
||||
({ test: () => assert(runPython(`_Node(_code).find_class("Employee").find_functions("level")[1].find_ifs()[2]`)) })
|
||||
```
|
||||
|
||||
When `new_level` is lower than `self.level`, you should raise a `ValueError` with the message `Cannot change to lower level.`.
|
||||
When `new_level` is lower than `self.level`, you should raise a `ValueError` with the message `Cannot change to lower level.`
|
||||
|
||||
```js
|
||||
({ test: () => runPython(`
|
||||
|
||||
@ -7,7 +7,7 @@ dashedName: step-2
|
||||
|
||||
# --description--
|
||||
|
||||
Inside the first `div` element, create a `span` element with the text `Soundflow`, a `h1` element with the text `Discover New Music`, and a `p` element with the text `Stream your favorite tracks and discover new artists.`.
|
||||
Inside the first `div` element, create a `span` element with the text `Soundflow`, a `h1` element with the text `Discover New Music`, and a `p` element with the text `Stream your favorite tracks and discover new artists.`
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ Under the `p` element you just added, create another `p` element with the text `
|
||||
|
||||
# --hints--
|
||||
|
||||
You should create another `p` element with the text `Start exploring millions of songs with basic features and ads.`.
|
||||
You should create another `p` element with the text `Start exploring millions of songs with basic features and ads.`
|
||||
|
||||
```js
|
||||
const paragraphs = document.querySelectorAll("p")
|
||||
|
||||
@ -15,7 +15,7 @@ Remember to replace `[subject]` with the `subject` variable and use proper templ
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `console` statement should output the message `Here is an example of accessing the first letter in the word [subject].`.
|
||||
Your `console` statement should output the message `Here is an example of accessing the first letter in the word [subject].`
|
||||
|
||||
```js
|
||||
assert.match(code, /console\.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+first\s+letter\s+in\s+the\s+word\s+\${subject}\.`\);?/);
|
||||
|
||||
@ -15,7 +15,7 @@ Then add another `console` statement that outputs the second letter of the `subj
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `console` statement should output the message `Here is an example of accessing the second letter in the word [subject].`.
|
||||
Your `console` statement should output the message `Here is an example of accessing the second letter in the word [subject].`
|
||||
|
||||
```js
|
||||
assert.match(code, /console\.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+second\s+letter\s+in\s+the\s+word\s+\$\{subject\}\.`\);?/);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user