How to get a 'decimal' type?


38
views
0
5 months ago by
In the Assignment 1 - Movies, 1.2 Summary Statistics of Single Variables, it asks for us to answer in type: Decimal. However, I cannot find it anywhere if Decimal is even a python data type, or how to change a character into a decimal. So my question is: Is Decimal a data type? and if so how can I make a number into a Decimal?

1 Answer


0
5 months ago by
In programming, they often refer to decimal values as "floats". You can convert an integer, for example 3, to a float like this:
float(3)​ # gives 3.0
Please login to add an answer/comment or follow this question.

Similar posts:
Search »