fstring number format python

num = 10.4999
print(f"The formatted number is {num:.2f}")
# output: The formatted number is 10.49

Here is what the above code is Doing:
1. We have a number, num, set to 10.4999.
2. We use an f-string to print out a formatted version of that number.
3. The format specification {num:.2f} says to print num using a floating-point number with 2 decimal places.
4. The output is 10.49.