1 –
'Hello, {}'.format(name)
Output
'Hello, Bob'
2 –
'Hey {name}, there is a 0x{errno:x} error!'.format(name=name, errno=errno)
Output
'Hey Bob, there is a 0xbadc0ffee error!'
3 –
f'Hello, {name}!'
Output
'Hello, Bob!'
Daily Notes of a Programmer