I want to make a python program that divides '1/7' in python however all I get is : 0.14285714285714285
. How can I compute more digits after the decimal?
You should use the decimal
datatype instead of float
. It's in the standard library.
There is an example of 1/7
with specified precision at the top of the decimal docs.