Consider a variable var with some value in it. How can we achieve an output of this format:

"This is the value of variable one: <value of variable>"?

a. print(‘This is the value of variable one:’)

b. print(‘This is the value of variable one:’, var),

c. print(This is the value of variable one: one)

d. print(‘This is the value of variable’, one, ‘:’) ,

1 answer

Option b. print(‘This is the value of variable one:’, var) is the correct answer. The comma after the string allows us to concatenate the string and the value of the variable together in the same print statement.