What is f string li…
 
Notifications
Clear all

What is f string literal ?

2 Posts
2 Users
1 Likes
547 Views
0
Topic starter

Give explanation and an example.

1 Answer
1

Also called “formatted string literals,” f-strings are string literals that have an f at the beginning and curly braces containing expressions that will be replaced with their values. The expressions are evaluated at runtime and then formatted using the __format__ protocol.ython f-strings is introduced to have minimal syntax for string formatting. The expressions are evaluated at runtime. If you are using Python 3.6 or higher version, you should use f-strings for all your string formatting requirements.

Rivek.t Rivek.t Topic starter 03/06/2023 5:14 am

@jisha-c Thanks for the answer.

Share: