str format float python code example Example: float print format python print("x = {:.2f}".format(x))