This lecture you will learn python Print Formatting with Strings!
Print Formatting with Strings
Dynamic generation of text
first = ‘alice’
last = ‘mary’
Ex- string concatenation
message = first + ' [' + last + '] is a software engineer’
print(message)
Ex- string – formatted string (f - indicates formatted string prefix)
msg = f’{first} [{last}] is a software engineer’
print(msg)
code page -
msg = f'{first} [{last}] is a software engineer'
print(msg)