What will be the output of this code using f- strings?

PythonPr's tweet image. What will be the output of this code using f- strings?

C and Gemini seems to like your example too! 😜

morganlinton's tweet image. C and Gemini seems to like your example too! 😜

C f-string is so cool! 😃


F-strings are used to concatenate variables in python. So it add the value of the variable to the string. Variable "name" value is Alice, and variable "age" value is 30. Adding that to the string gives: Alice is 30 years old


C The F string prints formatted text a single line including variables. Without the f string it displays: {name} is{age} years old


Answer is C. Name has been assigned the value of "Alice" name = "Alice" Age has been assigned the value of of "30" age = "30" The F string allows this to be printed as "Alice is 30 years old."


Good ol’ format


C of course


Confused about the 'f' I function


Too easy to answer


Answer is, option C


the answer is "c"


United States Trends
Loading...

Something went wrong.


Something went wrong.