Can someone help me with the explanation of what the "'f %" meaning in the following code?
print('Slope: %.3f' % lr.w_[1])
Here is a list of string formatting options in Python. You use a %
as a placeholder, which is replaced by lr.w_[1]
in this case. The f
then refers to "Floating point decimal format". The .3
indicates to round to 3 places after the decimal point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With