What does %d do in this line? : <p>What does %d do in this line of my code?</p>

<pre><code>puppy+="and Puppy %d (User %d) "%((j+1),(i+1))
</code></pre>

<p>Here's my code.</p>

<pre><code>u=int(input("Number of users:"))
puppy=""

for i in range (0,u):
  upos=input("Position of User "+str(i+1)+":")
  upos_list=upos.split()
  upos_x=int(upos_list[0])
  upos_y=int(upos_list[1])
  p=input("Number of puppies for User "+str(i+1)+":")

  for j in range (0,int(p)):
    ppos=input("Position of Puppy "+str(j+1)+":")
    ppos_list=ppos.split()
    ppos_x=int(ppos_list[0])
    ppos_y=int(ppos_list[1])     

    d=abs((ppos_x)-(upos_x))+abs((ppos_y)-(upos_y))
    if d&gt;10:
      puppy+="and Puppy %d (User %d) "%((j+1),(i+1))

if puppy=="":
  print("No puppies too far away")
else:
  print(puppy[4:]+"too far away")
</code></pre>

<p>Here's the input and output for your reference.</p>

<p><a href="https://i.stack.imgur.com/EyvfX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EyvfX.png" alt="Here&#39;s the input and output for reference"></a></p>
