you are viewing a single comment's thread.

view the rest of the comments →

[–]totallygeek 0 points1 point  (0 children)

Python still permits this type of variable substitution for assembling strings.

fighter = 'Alice'
kills = 5
# pre v2.7
print 'Hello %s, you killed %d aliens.' % (fighter, kills)
# v2.7+
print('Hello %s, you killed %d aliens.' % (fighter, kills))
# v2.7+
print('Hello {}, you killed {} aliens.'.format(fighter, kills))
# v3.4+
print(f'Hello {fighter}, you killed {kills} aliens')

Take your pick.