73 Examples to Help You Master Python's f-strings
Here is an interesting article (and thread) on Python f-strings.
I recently needed to center a string between two |
symbols. The ^
symbol is what tells Python to center the string.
Example:
# 10 is the maximum string length that 'team' will ever be
print(f"| {team:^10} | ")