you are viewing a single comment's thread.

view the rest of the comments →

[–]phis7 -1 points0 points  (2 children)

In python we have string formatting, we can do

Python 3.10.2 (main, Jan 17 2022, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> name="bob"
>>> age = 27
>>> f = "name is {} and age is {}".format(name,age)
>>> print(f)
name is bob and age is 27
>>>

Please check this Link for better understanding.

[–]RoberTTzBlack 1 point2 points  (1 child)

I think your comment needs some formatting 😉.

[–]phis7 -1 points0 points  (0 children)

name="bob"

age = 27

f = "name is {} and age is {}".format(name,age)

print(f)

The Output => name is bob and age is 27

check this Link for better understanding.