how to use string interpolation in python code example
Example 1: python string interpolation
name = 'World'
program = 'Python'
print(f'Hello {name}! This is {program}')
Example 2: string interpolation
/*In order to embed expressions within normal strings,
you would use the following syntax:*/
let a = 5;
let b = 10;
console.log('Fifteen is ' + (a + b) + ' and\nnot ' + (2 * a + b) + '.');
// "Fifteen is 15 and
// not 20."
/*Now, with template literals, you are able to make use of the syntactic sugar,
making substitutions like this more readable:*/
let a = 5;
let b = 10;
console.log(`Fifteen is ${a + b} and
not ${2 * a + b}.`);
// "Fifteen is 15 and
// not 20."