Why is f""" at the beginning of the prompt and text vars

Hello DLAI,

Why is f"“” used at the beginning of the prompt and text vars in the Guidelines notebook ?

Thank you

– Germán

1 Like

Hello @dlphsrle7 ,

Here we use “ f"" ” in Python to create a formatted string.
It dynamically embeds values of expressions or variables within the prompt string. It helps to create a complex paragraph as a string without concatenation of multiple small strings. It also helps in optimization like preventing possible errors that can happen for incorrect spacing, etc.

With regards,
Nilosree Sengupta

3 Likes

Hello Nilosree,

Thank you so much for this clarification and detail.

Much appreciated.

– Germán

1 Like

Hello @dlphsrle7 ,

You’re welcome!!
Happy learning!

With regards,
Nilosree Sengupta

Is it possible to use f"" or f" also, instead of f"“” ?