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
Arithmetic Formatter (Certification Project) #231
Comments
Project prototype: https://repl.it/@BeauCarnes/fcc-arithmetic-arranger |
Typo on the sixth bullet point. |
Thank you for catching this @notingGone. We'll be sure to update this before the release. |
implies: |
def test_simple_arangement(self):
actual = arithmetic_arranger(["235 + 52"])
expected = " 235\n+ 52\n-----"
self.assertEqual(actual, expected) For me it was helpfull to have a very simple test based on the first README example before the |
And
As @notingGone points out, the text describes a range, while the error message seems to suggest we should test for the upper threshold only. The function has always at least one problem, and we always consider positive integers, so perhaps the text should describe only the greater boundary?
I believe the single space should be between the operator and the longest of the two numbers. For instance with '235 + 5', the space is between the plus sign arithmetic_arranger(['235 + 5'])
'''
235
+ 5
-----
'''
I might be daft, but this one puzzled me a little. It describes the number of spaces between successive problems, right? The word vertically lead me to think the test was about the height of the individual problems. Apologies if these notes sound like nitpicks. The README file was overall easy to understand and I was able to complete the project. |
I agree with what @borntofrappe said (#231 (comment)). All I have to add is a nitpick (I know these aren't important 😅): these two bullet points do not have their full stops.
|
Thanks everyone for your review. We'll take this all into account as we work on the next draft. Given that each number in the problem should be between one and four digits long, the text As for testing only the upper range of problems passed to the function, we could include text in the README saying that there will always be at least one problem passed to the function. We could also mention that each number in the problems will be at least one digit long. Otherwise we could include a requirement for another error message for each requirement, maybe something like @borntofrappe, that's a good point about the |
@scissorsneedfoodtoo quite challenging indeed Beside updating the text, I would also suggest we'd swap the last two bullet points. This because the very last point describing the dashes refers to the individual problem, and is more connected to the previous points than the penultimate one. Perhaps this is what confused me in the first place. Hope it's not brash, but maybe the following description might help:
I'd label them different, or successive, or multiple. Whichever describes the disconnect between the operations best. |
@borntofrappe, not brash at all, we really appreciate all the input. We're so familiar with these problems and what the expected output should be that it's difficult for us to see the parts that are unclear. Your perspective is a huge help making these descriptions as clear as possible. I agree, switching those two bullet points is a good idea and should help with clarity. Also those alternative word choices for the last bullet point are all good. Maybe something like "There should be four spaces between each successive arithmetic problem" or "There should be four spaces between each problem." |
Thanks everybody for the suggestions! I've implemented all the suggestions so far. |
I may have gotten carried away, but I felt there were some subtleties that would make the assignment more clear. So I went through most of the README and made the modifications, mostly in the Rules section that I added. AssignmentStudents in primary school often arrange arithmetic problems vertically to make them easier to solve. For example, "235 + 52" becomes:
Create a function that receives a list of strings that are arithmetic problems and returns the problems arranged vertically and side-by-side. For exampleFunction Call:
Output:
RulesThe function will return the correct conversion if the supplied problems are properly formatted, otherwise, it will return a string that describes an error that is meaningful to the user.
DevelopmentWrite your code in TestingThe unit tests for this project are in SubmittingCopy your project's URL and submit it to freeCodeCamp. |
Perhaps the line that says "four spaces" should have the word "should" be changed to "will", so that way someone doesn't assume they can string fomat a tab in there like I did. |
@Gerschel I really like your wording! Thanks for taking the time to rewrite this. I updated the project to incorporate most of your suggestions. |
The url to my project is: arithmetic formatter. |
This is a great project to get learn string formatting. I enjoyed solving it. |
It really helped me to learn some formatting. Here is the link of my resolution: arithmetic_arranger Roberto. |
The README.md says:
But the UnitTests look for:
There should be a period at the end of the sentence in the .md file to be consistent with the other error strings. |
Link to my solution: |
@mike-lloyd03, awesome, thank you for catching that. I'll update the README to reflect that. |
Hi, Loved the project. Found no glitches. Learnt formatting and googled a lot. Link : https://repl.it/@ManshulArora/ArithmeticArranger#main.py |
@manshul1807, great, thank you for your feedback. Please let us know what you think about the other projects, too. |
I'm revisiting the project since I first examined it back in February. Am I correct to assume the prototype is now at the following URL @scissorsneedfoodtoo ? https://repl.it/@freeCodeCamp/fcc-arithmetic-arranger It seems there's an additional test with respect to the original. I hope to have something constructive to add soon 👍 |
@borntofrappe Yes, that is the new URL to review. And you are right, there is a new test. Thanks for your help reviewing this! |
A few notes on the starter files. arithmetic_formatter.pyThe starter code fails not because the function is incomplete, but because there is an error in the return value def arithmetic_arranger(problems):
- return arranged_problems
+ return problems I believe this comes from the previous version of the project, but it's worth a fix. test_module.pyA very minor fix to line 7, where the word arrangement is missing a letter. -test_arangement
+test_arrangement README.mdThe README file is clear enough, but I have a few suggestions for the wording of a few sentences. The paragraph introducing the assignment can be re-worded to add more emphasis to the input argument and return values.
The list of rules is perhaps better introduced describing the requirements in two separate bulleted lists.
|
In the spirit of discussion, I also have a couple of questions regarding the code of Function definitionIn the starter project, the function is defined as accepting a single argument. def arithmetic_arranger(problems): However, the assignment asks for an optional second argument. def arithmetic_arranger(problems, show_solutions=False): Should we initialize the argument, or let the campers fill in the required syntax? Given the structure of the README, it seems reasonable to leave the code as-is, but I wanted to ask for a second opinion still. It is worth mentioning that, without the mention of the optional argument, there is an error with the final test, as the function is called with more positional arguments that it is equipped to. def test_solutions(self):
actual = arithmetic_arranger(["32 - 698", "1 - 3801", "45 + 43", "123 + 49"], True) Something to be aware of when testing the program. import librariesCampers should be able to complete the assignment without importing additional libraries. However, and especially after solving the challenges of the Python for Everybody module, it seems reasonable to import the Perhaps it excessive to add the import statement in the initial code, but should we add a line in the README on the use of libraries, whether they are accepted and in which measure? I hope the questions are clear enough. Let me know if you need further input :) UpdateHere's a link to my solution: https://repl.it/@borntofrappe/fcc-arithmetic-arranger I completed the assignment without the
Perhaps we should include this instruction in this project as well, at the bottom of the section detailing the rules. |
Hi @borntofrappe, thanks for all of your helpful suggestions. I went in and changed As for You bring up good points about the function definition and possibly adding a "Do not import any Python libraries" note. I'm not sure it's necessary here because |
I see your point @scissorsneedfoodtoo Using the I now also understand the reasoning behind the default return statement, and apologize for having made the same suggestion in the Time Calculator project. It works as a prompt, to give a direction to campers 👍 |
No worries @borntofrappe, thanks for all of your great suggestions. It's definitely worth considering everything you pointed out, even the default return statement. I'm sure other people will point out the same thing and we're always open to making changes to improve clarity. |
Hey! When I tried running your code, I received some errors. (can't use .split() on a list, nor on integers) for i,problem in enumerate(problems): remedied by: Then I have a question--I know the test runs to check if we followed the guidelines, but is the output supposed to say FAILED (failures=6) at the bottom? Did I mess up? https://replit.com/@alwaysasking/boilerplate-arithmetic-formatter#arithmetic_arranger.py ^^ the code I submitted |
Hi @alwaysasking, thanks for reaching out about this. For help with the coding challenges, please check out the forum at https://forum.freecodecamp.org. The contributors there are very active, and can help answer and questions you might have. Also, there's a good chance that someone else had a similar issue and was able to work it out, so please make sure to search through the existing threads before creating a new one. |
Create project from the Python scientific computing certification.
The text was updated successfully, but these errors were encountered: