new format python code example
Example 1: new python string formatting
>>> f'Hello, {name}!'
'Hello, Bob!'
Example 2: python format new
a = 1.2345
print(f"a = {a:.2f}")
#Output: a = 1.23
>>> f'Hello, {name}!'
'Hello, Bob!'
a = 1.2345
print(f"a = {a:.2f}")
#Output: a = 1.23