use an f string. the parameter for fixed decimal places is ._f. so something like
print(f'{number:.3f})
One way to do it is to use a format statement:
'{:.3f}'.format(variable) will always display three digits after the decimal.