Skip to content

Commit 3e58775

Browse files
Merge pull request geekcomputers#2890 from PortalWalkerCodes/patch-1
Add f string example
2 parents 531785b + 0644627 commit 3e58775

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Strings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@
2121
Life"""
2222
print("\nCreating a multiline String: ")
2323
print(String1)
24+
25+
# Use F string to incert variables with {
26+
String1 = "4"
27+
print(f"I am an f string. 2 + 2 = {String1}")

0 commit comments

Comments
 (0)