Skip to content

Commit

Permalink
Final QA updates (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
gahjelle authored Oct 12, 2023
1 parent b01d29d commit 8adf0cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python-f-string/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Python's F-String: An Improved String Interpolation and Formatting Tool

This folder provides the code examples for the Real Python tutorial [Python's F-String: An Improved String Interpolation and Formatting Tool](https://realpython.com/python-f-string-update/).
This folder provides the code examples for the Real Python tutorial [Python's F-String: An Improved String Interpolation and Formatting Tool](https://realpython.com/python-f-string/).
7 changes: 5 additions & 2 deletions python-f-string/format_f_string.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from datetime import datetime

balance = 5425.9292
print(f"Balance: ${balance:.2f}")

Expand All @@ -14,5 +16,6 @@

date = (9, 6, 2023)
print(f"Date: {date[0]:02}-{date[1]:02}-{date[2]}")
date = (9, 26, 2023)
print(f"Date: {date[0]:02}/{date[1]:02}/{date[2]}")

date = datetime(2023, 9, 26)
print(f"Date: {date:%m/%d/%Y}")

0 comments on commit 8adf0cf

Please sign in to comment.