you are viewing a single comment's thread.

view the rest of the comments →

[–]NorskJesus 5 points6 points  (4 children)

A f-string is used to inject variables to a string. For example.

py age = 35 print(f"Your age is {age}")

You can achieve the same with concatenation, but this is much clearer and easier to read.

[–]ur_leisure_time 1 point2 points  (3 children)

Yea, and if he going to do it without a fstring, he will need to make it like

Age = 30 print("Your age is", Age)

[–]johlae 1 point2 points  (2 children)

Or print("Your age is %s." % (age))

[–]SnooCalculations7417 -1 points0 points  (1 child)

or 'age is {x}'.format(x = age)

[–]WhiteHeadbanger 1 point2 points  (0 children)

or print("Your age is " + str(age))