Why do I get “TypeError: not all arguments converted during string formatting” trying to substitute a placeholder like {0} using %?
Old-style % formatting uses % codes for formatting: # A single value can be written as is: ‘It will cost $%d dollars.’ % 95 # Multiple values must be provided as a tuple: “‘%s’ is longer than ‘%s'” % (name1, name2) New-style {} formatting uses {} codes and the .format method. Make sure not to … Read more