print(%s code example
Example 1: python format strings
name = "Rick"
age = 42
print(f"My name is {name} and I am {age} years old")
Example 2: String Formatting with the % Operator
>>> name = 'Bob'
>>> 'Hello, %s' % name
"Hello, Bob"
name = "Rick"
age = 42
print(f"My name is {name} and I am {age} years old")
>>> name = 'Bob'
>>> 'Hello, %s' % name
"Hello, Bob"