Last answered:

06 Jan 2023

Posted on:

28 Dec 2022

1

Using an F-string

Why couldn't I just use an f string?

3 answers ( 0 marked as helpful)
Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Posted on:

30 Dec 2022

0

I guess %s operator is in Python from python 2.0 and some were habitual to it so he tells about that while F-string introduced in python 3.6.
F-string easy to use and quite readable but its personal preference which one to use

Posted on:

31 Dec 2022

0

https://realpython.com/python-f-strings/ shows how the old way of formatting strings can quickly become hard to read.

Instructor
Posted on:

06 Jan 2023

0

Hi everyone!
Thanks for reaching out.

@: Mayank and Marvin

Thanks for sharing this piece of information with the Community!

@: Cynthia

The release of Python version 3.6 introduced formatted string literals, simply called “f-strings.” They are called f-strings because you need to prefix a string with the letter 'f' to create an f- string. The letter 'f' also indicates that these strings are used for formatting. Could you please share with us your code as a post? Thank you.

Looking forward to your answer.
Best,
Tsvetelin

Submit an answer