What are .
and :
doing in a print statement?
For example:
print(f'The estimated revenue for a $350 film is around ${revenue_estimate:.10}.')
this returns :
The estimated revenue for a $350 film is around $600000000.0.
But without :
and .
the result is exactly the same!
I searched and found nothing...
Here's your answer:
https://blog.teclado.com/python-formatting-numbers-for-printing/
I was working on the same problem and confused me as well.
After the colon dot, you specify the number of significant digits you want to print. Since your answer of 600000000.0 has exactly 10 significant digits, the whole thing printed. If you changed your code to:
print(f'The estimated revenue for a $350 film is around ${revenue_estimate:.9}.')
, you would see an output in exponent notation of
6e+08