Why in this exercise did we not have to identify the decimal module in namespace when using the Decimal function?
for example in the previous exercise when using the randint function we used it as random.randint() so I thought it would be a similar syntax for Decimal like decimal.Decimal()
brings that function into your program’s namespace, as though you had written the function yourself at the top of your program. In previous examples, we needed to specify which of our imported libraries we were referencing.
I understand the usefulness of the decimal module but, contrary to the exercise, Python on my local machine does not return strange answers to decimal addition as was spoken of in the tutorial. Why is this?
What happened with these lessons? We go from the previous module to ‘Modules’ with explanations on the syntax of what we’re using, and then get asked to use some decent logic to solve many of the problems, and then this whole unit they haven’t explained a ■■■■ thing! I’ve had to scour the internet for a half hour for each of the 4 pages so far and still haven’t found the correct syntax for any of these functions. I sure hope this improves
I agree. This exercise was a bit strange and it seemed to be lacking explanations. I also still don’t understand why we have to turn the floats into strings in order for the Decimal() module to work.
This is kind of insane. There’s been no instruction on how to specify decimal points desired, and when you get the solution code, I feel like I see no difference at all. There have been quite a few poorly explained lessons in Codecademy so far but this one is REALLY bad, and is brushing over almost everything it addresses, if it even touches on it at all.
This lesson is the equivalent of hey there’s this thing called decimal, import it and use it.
prints out 0.89 and 0.3445 accordingly. I’m just curious as to why four_decimal_points behaves the way it does. Is it something to do with the code within the library, or simply just multiplication vs addition?
So, then, if this isn’t the default Decimal module , then why are we using it? And if it is, I still don’t understand how it knew to give a two decimal answer for: two_decimal_points = Decimal('0.2') + Decimal('0.69') print(two_decimal_points)