Python Tutorial
What is F-String In Python

Hello, Guy’s Welcome To The Another Python Article In This Article We Learn What is F-String in Python.

What is the String?

Before We Understand F-String In Python. First We Discuss What is String. So String is Nothing But a Word Or Alphabet That You Are Use To Write Anything In You General Note Book That is Know As String.

What is F-String?

If You Want To Use Very Simple Text Formatting So We Use F-String. F-String Nothing But A Formatting Of Text That Help You To Easy Understand The Word Or Variable That You Are Write In A Print Statement.

Syntax:

print(f“STATEMENT”)

Where Denote The F-String. Under The Double Quotes, You Write Your Print Statement What You Want.

Note:- F-String Always Use Inside The Print Statement.

Question:

Write A Program That Print The Value Of X=50 Using F-String?

Answer:-

x = 50

Print(f”The Value Of X is {x}”)

Output:-

The Value Of X is 50

You Write The Value Of Variable Into Inside The { }.

Thanks For Reading This Article.