print(f”Add {200} grams of flour.”)
If I excluded the brackets and just wrote this as a regular string in Python, it would print the same way. Is there any reason why I would format an integer like this?
print(“Add 200 grams of flour”)
Would output the same string as the code above, is it best practice to format integers in python strings?
New contributor
Liam Gervais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1