FAQ: Modules: Python - Modules Python Decimals


#1

This community-built FAQ covers the “Modules Python Decimals” exercise from the lesson “Modules: Python”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Computer Science

FAQs on the exercise Modules Python Decimals

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


#2

The solution is:

three_decimal_points = Decimal(‘0.2’) + Decimal(‘0.69’)
print(three_decimal_points)
four_decimal_points = Decimal(‘0.53’) * Decimal(‘0.65’)
print(four_decimal_points)

I didn’t get the point here, and the solution gives two decimals on three_decimal_points!

Where in the solution it says to the program the number of decimals?


#3

Yeah I got the same result as brugerf:

three_decimal_points = Decimal('0.2') + Decimal('0.69')
print(three_decimal_points)

The above code only gives a result with 2 decimal points despite the exercise saying it should give 3 decimal points.


#4

The bug has been reported but will invite a team member to examine this topic.


#5

Which part of the code determines how many decimal points there will be?


#6

There is nothing in the instructions or description about there being any way to control it. Reporting as a bug.

This whole section is a mess.