What’s the difference between %s and %d in string formatting?
They are used for formatting strings. %s acts a placeholder for a string while %d acts as a placeholder for a number. Their associated values are passed in via a tuple using the % operator. name=”marcog” number = 42 print ‘%s %d’ % (name, number) will print marcog 42. Note that name is a string … Read more