Skip to content
New issue

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

Fix 'Computing the Value of a Polynomial' exercise #757

Merged
merged 1 commit into from
Nov 18, 2019
Merged

Fix 'Computing the Value of a Polynomial' exercise #757

merged 1 commit into from
Nov 18, 2019

Conversation

marijane
Copy link
Contributor

@marijane marijane commented Nov 18, 2019

The Output block in this exercise contains two assignments to the variable y, which neither looks like an Output nor does it follow from the preceding Python block when run.

I believe the first assignment to y was intended to be part of the Python block, and I also believe the intent was to print the value of y, which is 97, instead of assigning 97 to it in the Output block.

This commit does the following:

  • moves the first y assignment from the Output block into the Python block
  • adds a print(y) statement to the end of the Python block
  • removes the assignment from the y = 97 line, so that the Output block matches the output of the edited Python block when it is run.

The Output block in this exercise contains two assignments to the variable y, which neither looks like an Output nor does it follow from the preceding Python block when run.

I believe the first assignment to y was intended to be part of the Python block, and I also believe the intent was to print the value of y, which is 97, instead of assigning 97 to it in the Output block.

This commit does the following:
- moves the first y assignment from the Output block into the Python block
- adds a print(y) statement to the end of the Python block
- removes the assignment from the y = 97 line, so that the Output block matches the output of the edited Python block when it is run.
@maxim-belkin
Copy link
Contributor

maxim-belkin commented Nov 18, 2019

Thanks, @marijane. I think the change makes sense and this typo dates back to 2016 (bb8857f) when this exercise was first added to the lesson.

@annefou and @ldko: I think this piece misses a few words about cubic polynomial (e.g. "here is how we can compute a cubic polynomial" or something along these lines) -- what do you think?

Copy link
Contributor

@maxim-belkin maxim-belkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link

@annefou annefou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted @marijane
Thank you.

@maxim-belkin maxim-belkin merged commit 2f891d7 into swcarpentry:gh-pages Nov 18, 2019
zkamvar pushed a commit that referenced this pull request Apr 21, 2023
The Output block in this exercise contains two assignments to the variable `y`, which neither looks like an Output nor does it follow from the preceding Python block when run.

I believe the first assignment to `y` was intended to be part of the Python block, and I also believe the intent was to print the value of `y`, which is 97, instead of assigning 97 to it in the Output block.

This commit does the following:
- moves the first `y` assignment from the Output block into the Python block
- adds a `print(y)` statement to the end of the Python block
- removes the assignment from the `y = 97` line, so that the Output block matches the output of the edited Python block when it is run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants