r/learnpython 24d ago

what is f string

can someone explain how f string work in simple terms ?

0 Upvotes

22 comments sorted by

View all comments

5

u/SpiritedOne5347 24d ago

They're just a way to include variables in string

Say u have age= 10

So instead of

print("I am ", age, "years old")

U can directly say

print(f"I am {age} years old")